The only problem here is 'continue' statement. In your code, calling the 'continue' statement will result the execution to go back to the for loop for the next iteration. In the first case, calling the continue statement returns to the 'for' loop in which the value of 'i' is incremented. In the latter case the value of i is incremented after the continue statement. So if the continue statement is called in the second program, then the pointer returns to for loop without incrementing the value of i which makes the programs differ.

In first case, even if continue statement is called, value of i increases.
In second case, if continue statement is called, value of i remains the same.