Could anyone please explain how these expressions are evaluated?
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a = 1;
a = a++ + a++;
cout<<a<<endl;
a = 1;
a = ++a + ++a;
cout<<a<<endl;
a = 1;
a = a++ + ++a;
cout<<a<<endl;
a = 1;
a = ++a + a++;
cout<<a<<endl;
return 0;
}
OUTPUT: ~~~~~ 3 6 4 5 ~~~~~