) If the value of a = 20 and b = 20, then a+=b will assign ________ to a a) 40 b) 30 c) 20 d) 10
Answers
Answered by
5
Answer:
a+=b
a=a+b
a=20+20
a=40
Answered by
1
Option (a) 40 is the value that will be assigned to variable a.
Given,
The value of a = 20.
The value of b is 20.
To Find,
The value of 'a ' in the expression a+=b.
Solution,
Given that,
the value of 'a' is 20 and the value of 'b' is 20.
ANd the expression is,
a+=b.
Here, 'a' is the variable in the expression and the operand is 'b'.
In such an expression it means that the variable and the operand will add together and the result will be stored in the variable.
So, a+=b can be write as a = a+b.
Therefor,
a = a+b
a= 20+20
a= 40.
Hence, the expression a+=b will assign a value of 40 to the variable 'a'.
Similar questions