@Kailash: The code violates the sequence point rule, which says that you may not change the value of a variable more than once between sequence points. The result is compiler dependent.
Dave On Jan 21, 5:42 am, Kailash Bagaria <kbkailashbaga...@gmail.com> wrote: > Please explain the output of the following program.... > > #include <iostream> > using namespace std; > int main() > { > int i=5; > i=i++ + ++i; > cout<<i<<endl; > > int j=5; > cout<<j++ + ++j<<endl; > > int k=5; > k=k++ + k++ + ++k; > cout<<k<<endl; > > system("pause"); > return 0;} > > -- > > -- > > ‘Kailash Bagaria’ > B-tech 3rd year > Computer Science & Engineering > Indian Institute of Technology, Roorkee > Roorkee, India (247667) -- 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.