+ 3
How does += operator works??
5 odpowiedzi
+ 21
+= is a short version for addition
x+=y means x=x+y
i.e the value of x gets increased by adding y to it..
Similarly other operations can be
*= , -= , /=, %=
You can refer the chapters in the course, if not understandable you can view the comments posted there so as to get a clear picture about it...
+ 3
imagine a function call with infix notation just like any other infix operator like +,-,.,*. it gets expanded from x+=y to x = x + y.
+ 2
short version fr sum of two num to be stored in one of the variables.
for examples x+=y...is same as x=x+y...
hope you got it
+ 2
a=a+b; can be shortly expressed as a+=b;
+ 1
a+=b and a-=b are short forms for a=a+b and a=a-b respectively. Actually it has emphasis on the variable which is 'a' and is being manipulated (plus or minus) as 'b'. Therefor it seems logical to shorten it in this way. Hope it helps