[Solved] How does a while loop inside a for loop work?


It will enter the for loop first when i = 0. Immediately after it will enter the while loop and continue running indefinitely as i will always be 0 and therefore < 3. You perhaps need to deal with j in the break condition of inner loop for avoiding an infinite loop.

solved How does a while loop inside a for loop work?