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
Post a Comment