+ 4
Why
given here x+ = 6 x+6 now according to mathematics LHS = RHS x+ = 6 x-6 = 0 so why it is x+6
4 Answers
+ 13
x += 6;
is equivalent to x = x + 6, which is assigning the sum of x and 6 to x, not stating the equivalence between LHS and RHS.
+ 8
x += 6; is just a shortcut method to represent
x = x+6;
Here "=" is assignment operator, this means that new value of x becomes x+6, so you can't do LHS = RHS equivalence here.
In programming "==" means equal to operator and then you may do LHS = RHS.
Don't take the mathematics too seriosly and try to learn about basic syntax and operators etc. used in programming.
0
The users gived good explanation. In addition, you can use
x -=6; it is equal to x = x-6;
0
this is not a simple mathematics that we use in maths this is programming in which x+=6 is way to represent x=x+6.where x is increased by 6.