#include <iostream>
using namespace std;
int main(){
int j=0;
cout << ++j << j++ << j;
return 0;
}
To my knowledge, the output of the code must be 1 1 2 but the output of the code is 2 0 2, and this answer varies from compiler to compiler I am using the latest version of gcc. But when I use turbo c compiler the output is different.
So please explain the background working of the code.