In a do while loop, condition is checked for the value of the variable at beginning of loop or after inc/dec operator? | SoloLearn: Learn to code for FREE!

+1

In a do while loop, condition is checked for the value of the variable at beginning of loop or after inc/dec operator?

eg int x=1; do { printf("%d",x); x++; }while(x<5); here for the first execution, will the condition be checked for value of x as 1 in the beginning of the loop, or value 2 after the inc ?

1/18/2018 5:15:35 PM

Sarala devi CS

1 Answer

New Answer

+2

After everything in the loop.