Computer Science, asked by LoknathDas31, 8 months ago

Give the output of the following:

x + = x++ + ++x + --x + x--; when x= 9​

Answers

Answered by rutuja3270
2

Answer:

20

x = x + ( (x++) + (++x) + x) = 4 + ((x++) + (++x) + x) = 4 + ((4++) + (++x) + x) = 4 + (4 + ++5 + x) = 4 + (4 + 6 + 6) = 4 + 16 = 20

Answered by SaurabhJacob
0

The output to x will be 49.

In the given instruction,

Both the post-increment and pre-increment are used.

After putting the value as 9, The resolved expression comes to be,

                                    x+=10+10+10+10\\x=x+40\\x=49

Since 'x+=' means adding something to x and storing it in x.

Similar questions