Originally posted by Veena Point:
In the above code += has lower priority than increment operators.so it should be evaluated the following way
a += 2+2(3)
a=(int)3+2+2
a=7
Veena
In the above code += operator is not given higher priority it is evaluated after increment operator.
It is evaluated as under:
a(1) += ++a(2) + (2)a++
a(1) += 4
a = 1 + 4
a=5
I hope it will help you.