what is the difference between i++ and ++i?
i++ is post increment where ++i is pre-increment.
i++;//i is 5
now i is 6
++i;//i is 7
now i is 7
++i will increment the value of i, and then return the incremented value whereas i++ will increment the value of i, but return the pre-incremented value.