Operators in C | Relational operators

Relational Operators

The following table shows all the relational operators supported by C. 

Operator Description
< Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true.
> Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true.
Operator Description
<= Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true.
>= Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true.

 

 

Operator Description
== Checks if the values of two operands are equal or not. If yes, then the condition becomes true.
!= Checks if the values of two operands are equal or not. If the values are not equal, then the condition becomes true.

Note:
(1).Relation operators helps us to apply conditions. Whenever relation operators are used the result is always either true(1) or false(0).
(2). Non zero means true i.e. 1 and zero means false i.e. 0.