Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 4
In prefix (++i), the value of i is incremented first and then after value of the expression and thus becomes the new value of i .In postfix (i++), the value of i is incremented, and expression remains the same with the original value of i. For eg:- I is initialised a value of 5 so 1st prefix -
++i = 5 + 1 = 6
Show the value of the expression is 6.
Postfix :
ii. i++ = 5
in this the value of the initial expression will take place then after it will be incremented