+ 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

30th Dec 2017, 3:48 AM
Tony Stark
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.
30th Dec 2017, 3:52 AM
Hatsy Rei
Hatsy Rei - avatar
+ 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.
30th Dec 2017, 4:39 AM
Lakshay
Lakshay - avatar
0
The users gived good explanation. In addition, you can use x -=6; it is equal to x = x-6;
30th Dec 2017, 5:58 AM
zela321
zela321 - avatar
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.
31st Dec 2017, 4:56 AM
Satyam Ramani
Satyam Ramani - avatar