Why doesn't the code (2) below produce the same output as the code (1)? Let's say you entered "4" as input:
(1)
int x;
cout << "enter integer: ";
cin >> x;
cout << x++;
cout << ++x;
cout << x;
The output of the above is "466" (as expected).
(2)
int x;
cout << "enter integer: ";
cin >> x;
cout << x++ << ++x << x;
The output of the above is "554". Why??