If a = 5, b = 9, calculate the value of:
a += a++ - ++b + a [4]
Answers
Answered by
1
Answer:
6
Explanation :-
a += a++ - ++b + a
⇒ a = a + (a++ - ++b + a)
⇒ a = 5 + (5 - 10 + 6) [∵ a++ will first use current value of a then increment it to 6. ++b will increment b to 10 and use the incremented value. As a++ incremented a to 6 so the value of last a in the expression is 6]
⇒ a = 5 + 1
⇒ a = 6
Hope it helps !!!
Please mark me the brainliest !!!
If possible follow !!?
Answered by
2
QUESTION:-
If a = 5 , b=9 find:-
a+=a++ - ++b + a
ANSWER:-
a=6
STEP-BY-STEP EXPLANATION:-
a+= a++ - ++b +a
=a + a++ - ++b +a
=5+5-10+6
(The a++ describes first assign then increment so the value of a(5) will be assigned then the value of a will increase to 6 and b++ describes assign after increment so the value of b(9) will be increased and then assigned .)
=10-10+6
(By following the JAVA BEDMAS RULE OF HIERARCHY)
=0+6
=6
HOPE IT HELPS MARK AS BRAINLIEST
Similar questions