(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
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
Math,
5 months ago
Hindi,
5 months ago
Chinese,
9 months ago
English,
11 months ago
Political Science,
11 months ago