| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is the stackpointer | | 2 |
| identify the in correct expression
a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;
| TCS | 5 |
| 12. Look at the Code:
main()
{
int a[]={1,2,3},i;
for(i=0;i<3;i++)
{
printf("%d",*a);
a++;
}
}
Which Statement is/are True w.r.t the above code?
I.Executes Successfully & Prints the contents of the array
II.Gives the Error:Lvalue Required
III.The address of the array should not be changed
IV.None of the Above.
A)Only I B)Only II C)II & III D)IV
| Accenture | 4 |
| plz answer.. a program that takes a string e.g. "345" and
returns integer 345 | | 3 |
| write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]
| | 2 |
| What is #pragma directive?how it is used in the program?
what is its advantages and disadvantages? | | 1 |
| what is memory leak?
| | 3 |
| what is the differnce between AF_INET and PF_INET? | Wipro | 2 |
| what is use#in c | | 3 |
| main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
| CitiGroup | 7 |
| why java is called as a purely oops language. | | 2 |
| What are the preprocessors? | HP | 6 |
| How would you print out the data in a binary tree, level by
level, starting at the top? | Microsoft | 4 |
| main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
| CitiGroup | 17 |
| write a programe returns the number of times the character
appears in the string | | 1 |
| Study the code:
void show()
main()
{
show();
}
void show (char *s)
{
printf("%sn",s);
}
What will happen if it is compiled & run on an ANSI C
Compiler?
A)It will compile & nothing will be printed when it is
executed
B)it will compile but not link
C)the compiler will generate an error
D)the compiler will generate a warning
| Accenture | 4 |
| Reverse the part of the number which is present from
position i to j. Print the new number.
eg:
num=789876
i=2
j=5
778986 | | 1 |
| whether itis a structured language? | Microsoft | 1 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Find the output | CitiGroup | 4 |
| 15.what is the disadvantage of using macros?
16.what is the self-referential structure?
17.can a union be self-referenced?
18.What is a pointer?
19.What is the Lvalue and Rvalue?
20.what is the difference between these initializations?
21.Char a[]=”string”;
22.Char *p=”literal”;
23.Does *p++ increment p, or what it points to? | | 1 |
| |
| For more C Interview Questions Click Here |