Computer Science, asked by rameshlamba1433, 10 months ago

What will be the output , if x=2 ? t=x++ * 2+3 * --x

Answers

Answered by rajsingh22
0

I guess it should be 4.... but just for curiosity y run it in the Code Playground and got 3 as an output... so, I was driven to think that if you have several post-increment in the same statement for the same variable, only one is considered... but then I did another test with x = x++ + x++ + x++; and got 6 as the output....!!!????

So, I guess the code ground compiler it's not close to be perfect... ;-)


pratee10: please brother/sister don't guess and others opportunities
rajsingh22: ya sorry bro it was written by mistake.
Answered by pratee10
0
the value of t will be displayed but the value of x will be in memory
Attachments:
Similar questions