| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is the output of following program ?
int
main()
{
int x = 5;
printf("%d %d %d\n", x, x << 2, x >> 2);
} | Qualcomm | 3 |
| Hi,
main()
{
}
Is a user defined function or Built in Functionn | Honeywell | 9 |
| what does the following code do?
fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year
| TCS | 4 |
| how to find sum of digits in C?
| CTS | 10 |
| is compiler do read the data line by line or not.
?? | LG-Soft | 3 |
| f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
| Hughes | 4 |
| why the execution starts from main function | | 9 |
| Describe advantages and disadvantages of the various stock
sorting algorithms | Microsoft | 1 |
| what is the use of fflush() function? | | 1 |
| what are the compilation steps?
( i want inside the compiler ) | | 1 |
| what information does the header files contain? | BSNL | 5 |
| 2.main
{
int x,j,k;
j=k=6;x=2;
x=j*k;
printf("%d", x);
| HCL | 6 |
| sqrt(x+sqrt(x+sqrt(x+sqrt(x))))=2;
Find the value of x? | Subex | 2 |
| Can we include one C program into another C program if yes how? | Infosys | 4 |
| HOW TO SWAP TWO NOS IN ONE STEP? | Satyam | 12 |
| f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
| HCL | 4 |
| Explain following declaration
int *P(void);
and
int (*p)(char *a);
| | 2 |
| char S;
char S[6]= " HELLO";
printf("%s ",S[6]);
output of the above program ?
(0, ASCII 0, I,unpredictable)
| Mascot | 6 |
| what is the advantage of using SEMAPHORES to ORDINARY
VARIABLES??? | NSN | 1 |
| To what value are pointers initialized?
1) NULL
2) Newly allocated memory
3) No action is taken by the compiler to initialize
pointers.
| | 2 |
| |
| For more C Interview Questions Click Here |