1
visibility

If int y = 10 then find int z = (++y * (y++ + 5));

  • 165

  • 176

  • 180

  • 150

Increment operator has the highest precedence. So, ++y and y++ will be evaluated starting from left.
In ++y, the value of y will be incremented to 11 and then 11 will be used in the expression.
When y++ is evaluated, the current value of y i.e. 11 will be used and then y will be incremented from 11 to 12.

int z = (++y * (y++ + 5));
= 11 * (11 + 5 )
= 11 * 16
= 176