
if ( x == y ) Is x equal to y?
Ex:
if ( x == y )
cout << "X is EQUAL to Y\n";
if ( x != y ) Is x not equal to y?
Ex:
if ( x != y )
cout << "X is EQUAL to Y\n";
if ( x > y ) Is x greater than y?
Ex:
if ( x > y )
cout << "X is GREATER THAN Y\n";
if ( x < y ) Is x less than y?
Ex:
if ( x < y )
cout << "X is LESS THAN Y\n";
if ( x >= y ) Is x greater than or equal to y?
Ex:
if ( x >= y )
cout << "X is GREATER THAN OR EQUAL to Y\n";
if ( x <= y ) Is x less than or equal to y?
Ex:
if ( x <= y )
cout << "X is LESS THAN OR EQUAL to Y\n";
| Operators | Associativity | Type |
|---|---|---|
| () | left-to-right | parenthesis |
| *, /, % | left-to-right | multiplicative |
| +, - | left-to-right | additive |
| <, <=, >, >= | left-to-right | relationals |
| ==, != | left-to-right | equalities |
| <<, >> | left-to-right | stream operators |
| = | right-to-left | assignment |