Line 4: the variable i, increase it
Line 5: print variable i.
Line 6, increase variable i.
Line 7: print variable i.
Line 8: with i, increase it then print it
Line 9: print variable i, then increase it.
The postfix increment operator, where the ++ is after the variable name, will return the old value of the variable. So if i = 5, and you print the value of i++, you will get 5 (and i is incremented to the value 6).
The prefix increment operator, where the ++ is before the variable name, will return the new value of the variable. So if i = 5, and you print the value of ++i, you will get 6 (and i is incremented to the value 6).
i will still be 3. the i++ says 'return the old value, but increase it by 1. So we set i to 4 (due to the ++), we return the old value of 3, and then assign 3 to i.
Therefore, never never never write line 2.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors