int i = 10;
int j = 0;
do {
j++;
System.out.println("loop:" + j);
while (i++ < 15) { //line6
i = i + 20;
System.out.println(i);
} ;
} while (i < 2);
System.out.println("i_final:" + i);
Output:
loop:1
31
i_final:32
Why the i_final is 32 and not 31? As we can see the do_while loop has executed only once, so line 8 should also have executed only once, hence incrementing the value of "i" by 1. When did 31 increment to 32?