Relational Operators
Purpose | Operator example |
---|---|
less than | x < y |
less than or equal | x <= y |
greater than | x > y |
greater than or equal | x >= y |
equal | x == y |
not equal | x != y |
int i, j; /* some code setting i and j */ if ( i = j ) { /* some stuff */ }this sets i = j and then does some stuff if j is non-zero