In this code:
int y = 10;
int z = (++y * (y++ + 5));
What I expected
First y++ + 5
will be executed because of the precedence of the innermost parentheses. So value of y
will be 11 and the value of this expression will be 15. Then ++y * ()
will be executed. So 12 * 15 = 180. So z=180
What I got
z=176
This means that the VM is going from left to right not following operator precedence. So is my understanding of operator precedence wrong?