#include<iostream>
using namespace std;
int main()
{
int a=5, b;
cout<<a++<<endl<<a++<<endl<<++a<<endl<<++a<<endl<<++a<<endl<<a++<<endl<<a++<<endl<<a++<<endl<<a++<<endl<<++a;
return 0;
}
OUTPUT: 14 13 15 15 15 9 8 7 6 15
Can someone explain how the compiler got this output? I understood the pre-increment will be 15. But can someone explain how we're getting these post-increment values?