I am not able to understand sequence of evaluation in following program. As per standard, in each statement I have modified value of 'a' only once. Can anybody help me?
int a = 2;
int b = a+++a;
std::cout << b << " ";
a = 2;
b = a + + + a;
std::cout << b << " ";
a = 2;
b = a++ + a;
std::cout << b << " ";
a = 2;
b = a + ++a;
std::cout << b << std::endl;
Output: 5 4 5 6