Give the output of the following:
x + = x++ + ++x + --x + x--; when x= 9
Answers
Answered by
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
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,
Since 'x+=' means adding something to x and storing it in x.
Similar questions