increment and decrement operation | Sololearn: Learn to code for FREE!


increment and decrement operation

x=8:x++,y=7;y-- how is it assign the value

5/3/2020 8:29:53 AM


3 Answers

New Answer


Incremental operation is weird The assignment is make by the machine herself so when you do an incremenation the value of the variable change automatically The only contraint is the difference with --x anf x-- for more information contact me ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜


x++, ++x is short forms for x=x+1. x--, --x is short forms for x=x-1 These are called post(x++, x--) increment/decrement operations, (worked as first used then incremented in instruction),.. Pre increment/decrement ( ++x, --x) operation (worked as first incremented then used in instruction).. These are worked like this above way by expanding acoordingly at compile time..


X++ means increment the value of X by 1. Y++ means increment the value of Y by 1. X=8; X++; // Now the X will become 9. Y=7; Y++; // Now the Y will become 8. confusion will come only when you perform "assignment" (=) and "increment".(++) operation simultaneously. X=8; L=X++; //means first assign the value of "X" to "L" then increment the value of X by 1. Now X is "9" L is "8"