Line 5: This is a post increment. This means the value is used before it is incremented. The value of i before line 5 is 5, which is what gets printed. i is then incremented and becomes 6.
Line 6: This is a pre-increment. This means i is incremented before being used. I is currently 6, is incremented to become 7, then printed.