Answers for "post and pre increment"

3

pre-increment vs post-increment

++x (pre-increment) means "increment the variable; the value of the expression is the final value"
x++ (post-increment) means "remember the original value, then increment the variable; the value of the expression is the original value"
Posted by: Guest on April-28-2020
0

pre increment and post increment

Pre-increment (++i) − Before assigning the value to the variable, the value is 
incremented by one.

Post-increment (i++) − After assigning the value to the variable, the value is 
incremented.
Posted by: Guest on February-06-2022

Browse Popular Code Answers by Language