Let us now look at the full list of relational operators.
Operator |
Symbol |
Example |
Meaning |
Greater than |
> |
x > y |
x greater than y |
Equal to |
== |
x == y |
x is equal to y |
Less than |
< |
x < y |
x is less than y |
Greater than or equal to |
>= |
x >= y |
x is either greater than or equal to y |
Less than or equal to |
<= |
x <= y |
x is either less than or equal to y |
Not equal to |
!= |
x! = y |
x not equal to y |
Point to note over here is that “=” is an assignment operator, i.e. it is used to assign a value to a variable. And “==” is a relational(comparison) operator, i.e. it is used to compare the value of two variables.