what is the output of the following C code and how does it work? -


#include<stdio.h>   void main()  {      while(1)      {          if(printf("%d",printf("%d")))              break;          else              continue;      }  } 

how possible have statement in if clause?

the output undefined values

how come statement in if clause?

printf returns number of characters printed. non-zero value in c can evaluated true, can use return value test if condition.

beside all, program invokes undefined behavior because not passing argument %d in inner printf.


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -