Comparison operators are used to compare two values and return a Boolean value (true or false).
The following table shows the comparison operators in C:
Operator | Description | Example |
== | Equal to | a == b |
!= | Not equal to | a != b |
< | Less than | a < b |
> | Greater than | a > b |
<= | Less than or equal to | a <= b |
>= | Greater than or equal to | a >= b |
Example