#include using namespace std; /* Shows how the comma operator can be used to create a single expression from two or more expressions: ,. Both expressions are evaluated, but the final expression in the sequence determines the value of the comma expression ,. Also shows the "short-circuit" evaluation property of the ?: operator: the decrement following the colon is not evaluated when the predicate (the boolean test expression, here x==1) is true. */ int main(){ int x = 1; cout << (x==1 ? ++x, ++x : --x ) << endl; return 0; }