The code is undefined, meaning that a valid compiler can produce any result that it wants. Multiple side effects between sequence points are not defined. It would be perfectly acceptable for a valid compiler to shoot flying monkeys out of your monitor. And it would serve you right for writing such code. Don
On Apr 29, 3:31 am, MANNU <manishkr2...@gmail.com> wrote: > *Can anyone please explain me the output of this program:* > > int x=1; > int y=x++ + ++x + ++x + x++; > cout<<y; > cout<<x; -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.