Computer Science, asked by parthprajapati1381, 9 months ago

(b) What is the value of y after evaluating the expression given below? [2]
y += ++y + y– + –y; when int y = 8.
Ans.
y += ++y + y– + –y
y = 8 + ++y + y– + –y
y = 8 + 9 + 9 + 7
y = 33

Answers

Answered by prakharjain17
4

Answer:

since you have already posted answer. i m just going to explain that you have to follow left to right in evaluation. and ++ or -- if present before then you have evaluate and put in expression. if present after you have put value before and evaluate afterwards.

+= happens in start

Similar questions