PLz help me to solve a problem..

Any tell me what does this code mean ?
for ( printf("0");!printf("1");printf("0") );
It prints "01"
That code is actually nonsense and doesn't mean anything.
Where did you get it?
I got this ques in my technical interview.

The answer is "100".but i didn't know that how this code work .
Nope, it is 01.
I have even tested it.
http://ideone.com/Ys4nCd

First printf("0") (initialisation operation) executes and prints 0.
Executes loop variable (!printf("1")): printf("1") prints 1 and returns 1. It got negated and 0 is checked for trueness. It is false, so loop terminates.

Whoever said th it is 100 is wrong here.
Last edited on
Thanks sir.your ans is highly appreciable for me.
Topic archived. No new replies allowed.