Computer Science, asked by shivangiawasthi2jun2, 1 month ago

if x=3 and x+= ++x - --x + 4, what will be the final value of x

Answers

Answered by jasonfrancis1811420
0

Answer:

x = 9

Explanation:

x = 3;

x = ++x + (++x);

++x would increase ‘x’ by one and use this value. If you add 1 to the current value of x, which is 3, then you have 4.

x = 4 + (++x);

++x would increase ‘x’ by one again and use (again) this value. If you add 1 to the current value of x, which is 4, then you have 5.

x = 4 + (5);

x = 9

Similar questions