- Relational operators are used to compare values of two variables.
- As you can use these operators, you can find out if the values of any two variables are equal and if not equal, which variable is the value of which variable and which variable is small? Such operators are used with conditional statements (if, if-else, switch, for, while etc).
- These operators are used to check the condition.
- When the condition is true, the value becomes true and the value becomes false when the condition is false.
- All the relational operators that are being used in C language are given below.
Operators | Description |
== (Equal To) | This operator checks whether the values of both variables are equal. |
!=(Not Equal To) | This operator checks whether values of both variables are non equal. |
< (Lesser Than) | This operator checks whether the left operand is smaller than the value right operand. |
> (Greater Than) | This operator checks whether the left operand is larger than the value right operand. |
<= (Lesser than equal)) | This operator checks whether the left operand is equal to or equal to the value right operand. |
>= (Greater than equal) | This operator checks whether the left operand is larger than or equal to the value right operand. |
No comments:
Post a Comment
Please do not any spam link in Comment Box