int i = 0, j = 0, k = 0; do while (i++ < 3) System.out.print(k++); while (j++ < 3); Why would the output be 012? Wuldn't the do loop be executed 3 times?
do while (i++ < 3) System.out.print(k++); //prints 012 while (j++ < 3); Outer while does loop 3 times, but i has already incremented and is greater than 3, so inner while condition is false and nothing is printed. I hope this helps.