void main()

{

while(1){

if(printf("%d",printf("%d")))

break;

else

continue;

}

}



void main() { while(1){ if(printf("%d",printf("%d"))) break; ..

Answer / susie

Answer :

Garbage values

Explanation:

The inner printf executes first to print some garbage value.
The printf returns no of characters printed and this value
also cannot be predicted. Still the outer printf prints
something and so returns a non-zero value. So it encounters
the break statement and comes out of the while statement.

Is This Answer Correct ?    21 Yes 3 No

Post New Answer

More C Code Interview Questions

Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,


main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }

1 Answers  


why is printf("%d %d %d",i++,--i,i--);

4 Answers   Apple, Cynity, TCS,


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,






void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 Answers  


write a program in c to merge two array

2 Answers  


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

1 Answers  


to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD

6 Answers   Synergy,


main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  


main() { int i=400,j=300; printf("%d..%d"); }

3 Answers  


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

0 Answers   Microsoft,


Categories