+ 1
What is x +=3
can someone tell me what is the value of x here
5 Answers
+ 10
it's a short hand techniques
x*=3; //equivalent to x=x*3;
x+=3;//equivalent to x=x+3;
+ 4
It is a short hand for x=x+3
+ 3
x = x + 3;
x is 3 more than it was before. += is a short version of that. Same goes to -=, /= and so on
+ 2
It depends on what x was before.
For example:
// here, x is set to 0
x = 0;
// here, we set x to be x + 3 (0+3 = 3)
x += 3;
x += 3 is the same as x = x + 3. += is just a shorter way to say the same thing.
+ 2
Short hand for x=x+3; What's on the right-side is stored in the variable x.