Computer Science, asked by hozaifacreations, 18 days ago

int x=5 x= x++ + ++x - x++​

Answers

Answered by mukeshkumarrai70152
1

Explanation:

Step 1

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

Step 2

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

Step 3

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

step #3 is very important. x++ result is 5, but the variable ‘x’ value has been incremented to 6. so the next ‘x’ value is 6.

step4

x = 5 + 5 + (++6

= 5 + 5 + 7

= 17

so answer for int x=5; x += x++ + ++x; is 17

PLEASE MARK ME AS BRAINLIST ‼️

Similar questions