Expressions, Operators & Types

Answer & solution
Official answer: 0.0
Our answer: 0
Step through it (12 steps)
1. Prefix increment changes the operand before producing its value. Thus n=++m first makes m=11 and then assigns n=11.
2. Postfix increment produces the old value and increments the operand by the end of the full expression. Hence n1=m++ assigns n1=11 and leaves m=12.
3. The separate statements n-- and --n1 reduce n and n1 to 10. Their prefix/postfix distinction does not matter when their expression values are discarded. Finally n-=n1 computes n=10-10=0, which is printed. These modifications occur in separate full expressions, so there is no unsequenced-increment ambiguity.