Multiple choice c

What is the output of the following piece of code?

int x = 3, y = 5, z ;
z = x++ + ++y;

printf(“%d”,z);

  1. 8

  2. 9

  3. 10

  4. 11

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The expression x++ + ++y is evaluated. x++ uses the value of x (3) then increments it to 4. ++y increments y to 6 then uses 6. The sum is 3 + 6 = 9.