+ 2
What does total+= do?
11 ответов
+ 4
it simply means total = total + do
for example if your total = 0 and do = 10 and if you use this total + = do that is same as total = total + do then your answer comes out to be 10
+ 2
total+=do is similar to
total = total + do
+ 1
You can look it up under: basic concepts\basic arithmetric (9).
+ 1
Thanks alot
+ 1
please upvote useful comments, thanks
+ 1
It adds itself a value. ex: totalValue += 8 the same as: totalValue = totalValue + 8
+ 1
total += do means total=total + do
+ 1
Its just a faster way to do "total = total + (whatever you decide)". There are a lot of shortcuts like this mostly to make coding faster as you have to type less. It also looks less complicated cleaning up the look of your code and making it less messy looking.
0
it's simply means that total integer + do integer
0
its a combination of two operator. a + and a = . + has higher priority so first two operands are added and then the result is being set as the new value for the first operand.. those guys who created C did it too make it look cool but just cuased more confusion. total+= x; sums the values of total and x and after that sets total equal to that sum.
0
simply total = total + do