Explain what does this mean | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Explain what does this mean

total+=number; what is this sign +=

17th Nov 2016, 5:09 AM
stephen haokip
stephen haokip - avatar
5 Respuestas
+ 8
@Stephen total+=number; OR total=total+number;
17th Nov 2016, 5:10 AM
AlamSirji
AlamSirji - avatar
+ 1
x+=y is x = x + y it works with all arithmetic operations (x*=y is x = x * y).
17th Nov 2016, 5:36 AM
Adefful
+ 1
This is known as shorthand notation shorthand what is means a+=b a = a + b a-=b a = a - b a/=b a = a / b a*=b a = a * b a%=b a = a % b
21st Nov 2016, 9:14 AM
Chitransh Vishwakarma
Chitransh Vishwakarma - avatar
0
It means total = total + number
17th Nov 2016, 5:34 AM
Madhab Dhakal
Madhab Dhakal - avatar
0
it's the 'Add assignment operator' and I believe they covered above what it does lol
17th Nov 2016, 6:18 AM
Matt James
Matt James - avatar