main()
{
int i=0;
for(;i++;printf("%d",i))
;
printf("%d",i);
}
Answer:
1
Explanation:
before entering
into the for loop the checking condition is "evaluated". Here it
evaluates to 0 (false) and comes out of the loop, and i is incremented (note
the semicolon after the for loop).
Blog Author: Vijay Kumar
Go to: Java Aptitude
what if we give value of i=1
ReplyDeletethen the result is not expected by ur logic ...
plz explain
I guess If it were 1,then it would be an infinite loop since all the conditions are satisfied?
ReplyDelete