x = 1; std::cout << ((++x)+(++x)+(++x));
I expect the output to be 11, but it\'s actually 12. Why?
11
12
The code snippet will invoke Undefined behavior in both C/C++.Read about Sequence Point from here.