I am here from a competitive exam on "c". I cant able find the answer for the following c program :
int i=1;
do
while(i++>5);
while(i++>4);
while(i++>3);
The question is to find the final value of "i". I have find out that the output is "4" by using gcc. But, I can't understand the mechanism. Please explain me...
1st conditions
here i =1, it fails but increments it to 2.
2nd condition
again fails but increments i to 3
3rd conditions
again fails but increments i to 4
So, you end up with a 4