In the C and C++ programming languages, the comma operator is a binary operator that evaluates its first operand and discards the result, and then evaluates the second operand and returns this value (and type). But in the below code
#include<iostream>
using namespace std;
int main(){
int x =2;
if( x--, --x, x){
cout<<"First";
}else{
cout<<"Second";
}
return 0;
}
The output is 'Second' Why?? Please help