Computer Science, asked by bcom05083, 5 months ago

Find the value of x after execution:-

int x=0, y=0, z=0;

x=(++x+y--)*z++;
please tell me the answer fast plzzzz​

Answers

Answered by vermayogita182
2

Answer:

x=(1+0)*0

x=1*0="0".

++x is pre increment so its value become 1.but y-- and z++ are post dcrement and post increment respectively,so their value remains same in that line(statement).

hope it helps you

have a great day

Answered by remyanairlm
0

Answer:

The final value of x after execution is 0.

Explanation:

Given that: int x=0, y=0, z=0;

x = (++x + y--) * z++;

x = (++0 + 0--) * 0++;

x=(1 + 0) * 0;

x = 0;

This is because in prefix operator, the increment/decrement takes places before the execution but in postfix operator, the increment/decrement takes place after the execution.

Thus, the final value of x after the execution is 0.

Similar questions