Problem Statement - expression evaluation based on precedence

What is the value of y after evaluating the expression given below?
y+=++y + y– + –y; when int y=8

Solution

TC++ #4053

If int y = 8 we will put the value in expression and evaluate

y += ++y + y– + –y;
+= being the composite assignment, will be evaluated in the end so step 1 would to evaluate RHS
Step 1: RHS-> 9 + 9 + 7; //First y will pre-increment, second will remain 9, third will decrement twice
Step 2: y = y+25; //Composite operator expanded, original y will remain as it is while expanding. This is because y will be filled first but due to last precedence of assignment it will not be impacted.
Step 3: y = 8+25 ; //Original value of y will be used here