Sorry for the basic question. But does the code finish executing the inner while loop and then update the count in the outer for loop? or does it perform each variable update in an alternating fashion?
int j= 1;
for(int i=0; i< 5; i++)
Best How To :
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.