1. Determine the result of the following:
Assume a=30 & b=6
(i) a+=b;
(ii) a%=b;
(iii) a -=b;
(iv) a*-b;
Answers
Answered by
0
Answer:
a+=b, -24
a%=b, 20
24
I don't know
Answered by
0
Answers:
- a = 36
- a = 0
- a = 24
- -180
Explanation:
- += operator will add a and b and assign its result to a.
- % operator returns the remainder, in this statement the remainder will be 0 as 6 completely divides 30, so %= operator will calculate the mod ( get the remainder ) and assign the result to the left operand.
- -= operator will subtract the left operand with the right operand and assign the result to the left operand
- a × [-b]
Hope this helps you!
Similar questions