New course! Every coder should learn Generative AI!
Try a free lesson+ 4
What is +=
11 Answers
+ 12
when you write
a += b;
it is same as
a = a + b;
It just says "increment left side with value on right side". There are similar operators like -=, *=, /= or %= which work the same way.
+ 4
+= used to Addition
a=1
a+=3
then a=4
+ 1
it simply means +.
0
yes
0
x+=1 is the same x=x+1 the same with x=x/5 is the same as x=x/5
0
hi daniel
0
we have losts of like this operators...
+=;
-=;
/=;
*=;
which means....
suppose e.g.
x+=y;
which is nothing but...
x=x+y;
both are similar meaning,but representation are different.....
0
they r operater
0
if take example
if a=4,b;
then
a+=b
means
a=a+b;
is it clear if any doubt ask me
0
that means if take x=10
then x+=6
that means x=x+6
we will assign in simple way
0
when we see the operators
+=
-=
/=
*=
%=
if given the values as
a=5
a+=3
then b becomes
a=a+3
as like all we use all of these