first, arrange the code in a more readable way. this helps to better understand what the code is trying to do:
In the code above, you'll see that the do/while loop contains an inner while loop. In the first iteration of the outer loop, the inner loop is executed and prints out k values: 012. In the second iteration (j is incremented), i is evaluated and since its value no longer satisfies the 'i++ < 3' condition (by virtue of the previous iteration), the inner loop does not execute and k value is never printed. 'j' again is incremented and performs another loop and so on.