j++ returns the value of j then increments j.
++j increments the value of j then returns the value of j.

Can you work out why you're getting the different results now?