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

void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  


Link list in reverse order.

8 Answers   NetApp,


#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  


write a program to Insert in a sorted list

4 Answers   Microsoft,


write a c-program to find gcd using recursive functions

5 Answers   HTC, Infotech,


print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!

35 Answers   Tata Elxsi, TCS, VI eTrans,


union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4

3 Answers   HCL,


Is the following code legal? struct a { int x; struct a *b; }

2 Answers  


main() { int i=5; printf("%d",++i++); }

1 Answers  


how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.

19 Answers   Cap Gemini, Infosys,


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

0 Answers  


main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


Categories