What I the difference between i++ and ++i??
Answers
Answered by
5
In i++ , i refer to a integer which is going to be added with 1. Whereas, in ++i, i refers to integer which is the result came after adding 1.
For example,
Let i = 5
Then
In i++, i is 5 and it means 5 + 1
And in ++i, i is 6 and it means 5+1 = 6 which is the result and the new value of i.
For example,
Let i = 5
Then
In i++, i is 5 and it means 5 + 1
And in ++i, i is 6 and it means 5+1 = 6 which is the result and the new value of i.
Similar questions