I came across a strange behavior while using increments operators in cout. The code is supposed to print 10 11 12 13 but it prints in reverse. ie 12 11 10 13.
int y = 10;
cout << y++ << y++ << y++ << y;
I tried doing
cout << y++ << y-- << y++ << y;
and this works fine and print 10 11 10 11