ICSE Class 9 Computer Applications Question 7 of 21

Operators in Java — Question 7

Back to all questions
7
Question

Question 7

If x = 3, y = 7, calculate the value of:
x -= x++ - ++y

Answer

    x -= x++ - ++y
⇒ x = x - (x++ - ++y)
⇒ x = 3 - (3 - 8)
⇒ x = 3 - (-5)
⇒ x = 3 + 5
⇒ x = 8