I am using the increment operator in prefix n postfix in C++, but i m getting incorrect results, can anyone please guide me n tell me what i m doing wrong :) Thank you :) here is my code :)
#include <iostream>
using namespace std;
int main()
{
int a=0;
cout<<a++<<endl<<++a<<endl;
}
Expecting Result
0
2
but i m getting Result
1
2