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=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }

3 Answers  


void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

0 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

1 Answers  






abcdedcba abc cba ab ba a a

2 Answers  


Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.

21 Answers   ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,


Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);

1 Answers  


How to return multiple values from a function?

7 Answers  


main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }

1 Answers  


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

1 Answers  


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


Categories