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

How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

0 Answers  


main() { int i = 3; for (;i++=0;) printf(ā€œ%dā€,i); }

1 Answers   CSC,


Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print

2 Answers  


main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers   CSC,


main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,






main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }

3 Answers  


How to access command-line arguments?

4 Answers  


In a gymnastic competition, scoring is based on the average of all scores given by the judges excluding the maximum and minimum scores. Let the user input the number of judges, after that, input the scores from the judges. Output the average score. Note: In case, more than two judges give the same score and it happens that score is the maximum or minimum then just eliminate two scores. For example, if the number of judges is 5 and all of them give 10 points each. Then the maximum and minimum score is 10. So the computation would be 10+10+10, this time. The output should be 10 because 30/3 is 10.

0 Answers   TCS,


void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!

1 Answers  


Categories