I am expecting a value as 10 and 10 from below code but getting it as 11 10 as the output, not sure why. I also tried ++a instead of a++ and got the output as 11 11(I know how it worked). I want to demonstrate increment operator. I know that if I write a++ on first line and then print the value of a it will show me the incremented value. please advise what change should I make in the cout statement to get the output as 10 11.
void main()
{
int a = 10;
cout<<a<<" "<<a++;
}