include
int main() {
using std::endl;
using std::cout;
int a=0;
cout << a++ << endl << ++a << endl;
int b=0;
cout << b++ << endl;
cout << ++b;
}
The output is 1 2 0 2. Why does a ++ output 1? Shouldn't it be 0? Can anyone tell me the principle!