What will be the result stored in x after evaluating the following expression? z+=(++z)+(z++)*z Show the steps.
Answers
Answered by
2
Answer:
12
Explanation:
int z=1;
Firstly:
++z then z=2 its pre-increment and after that z++ its post so value will be assigned first 2*z now z here is 3 (because 2 is assigned and after assignment it becomes 3) 2*3=6+3=9
z=z+9;(z=3)
z=12
so 12 is the answer
Similar questions
English,
5 months ago
Geography,
5 months ago
Math,
5 months ago
Hindi,
10 months ago
Social Sciences,
10 months ago
Social Sciences,
1 year ago