0

What does x++ mean?

Do I add the initialized x before or after adding itself again?

23rd Sep 2017, 10:59 AM
Joseph
Joseph - avatar
3 Answers
+ 2
Post-increment operator is used to increment the value of variable as soon as after executing expression completely in which post increment is used. In the Post-Increment value is first used in a expression and then incremented. b = x++; In this example suppose the value of variable ‘x’ is 5 then value of variable ‘b’ will be 5 because old value of ‘x’ is used.
23rd Sep 2017, 11:18 AM
Abhineet Singh
Abhineet Singh - avatar
+ 2
int x =4; console.writeline(x++); -> output 4 and x is now 5 console.....(++x); -> output 5 and x is now 5 obvi
23rd Sep 2017, 11:20 AM
Kawaii
Kawaii - avatar
+ 1
In an easy word: x++=x+1
23rd Sep 2017, 1:19 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar