0

increment and decrement operation

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

3rd May 2020, 8:29 AM
veeralakshmi.v
veeralakshmi.v - avatar
3 odpowiedzi
+ 1
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 😁 😁 😁 😁
3rd May 2020, 8:44 AM
HEUBA BATOMEN Franck Duval
HEUBA BATOMEN Franck Duval - avatar
0
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..
3rd May 2020, 12:11 PM
Jayakrishna 🇮🇳
0
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"
3rd May 2020, 8:05 PM
Dasarath Singh