These are used to test the relation between 2 values or 2 expressions. All C Relational Operators are binary operators and hence it requires 2 operands.
1. less than (<)
The less than operator is used to check if the left(a) side operand is less than(<) the right(b) side operand the value becomes True, Otherwise the value becomes False.
Eg: a=2, b=3 than a<b
2. greater than (>)
The greater than operator is used to check if the left(a) side operand is greater than(>) the right(b) side operand the value becomes True, Otherwise the value becomes False.
Eg: a=10, b=5 than a<b
3. less than or equal to (<=)
The less than or equal to operator is used to check if the left(a) side operand is less than or equal to(<=) the right(b) side operand the value becomes True, Otherwise the value becomes False.
Eg: a=3, b=3 than a<=b
4. greater than or equal to (>=)
The greater than or equal to operator is used to check if the left(a) side operand is greater than or equal to(>=) the right(b) side operand the value becomes True, Otherwise the value becomes False.
Eg: a=10, b=10 than a>=b
5. equal to (==)
The equal to operator is used to check if the left(a) side operand is equal to(==) the right(b) side operand the value becomes True, Otherwise the value becomes False.
Eg: a=2, b=2 than a==b
6. not equal to (!=)
The less than operator is used to check if the left(a) side operand is not equal to(!=) than the right(b) side operand the value becomes True, Otherwise the value becomes False.
Eg: a=2, b=3 than a!=b
Next Topic : Logical Operators
Previous Topic : To enter any Two Numbers and test all Arithmetic Operators
No comments:
Post a Comment