+ 1

WHAT IS THE meaning of y=-x++

WHAT IS THE meaning of y=-x++

3rd Oct 2017, 12:24 PM
Malhar Mujumdar
Malhar Mujumdar - avatar
2 Answers
+ 3
- (minus) sign is for making the output negative x++ is used for incrementing the value of x by 1. But it is post increment operation, it won't make any difference in the value of y. x will increase by 1. Example: x=1; y=-x++; print(y); //output => -1 print(x);. //output => 2
3rd Oct 2017, 12:09 PM
Ankit Agrawal
Ankit Agrawal - avatar