Why this code has different output on different compilers?
int main() {
int x=5, y=5;
cout<<x--;
cout<<",";
cout<<--x;
cout<<",";
cout<<y--<<","<<--y;
return 0;
}
Output on Turbo C:
5,3,4,4
Output on GCC:
5,3,4,3
Professional way of Programming
int main() {
int x=5, y=5;
cout<<x--;
cout<<",";
cout<<--x;
cout<<",";
cout<<y--<<","<<--y;
return 0;
}
Output on Turbo C:
5,3,4,4
5,3,4,3