21 Nov 2019

  • November 21, 2019
  • Amitraj
3.) Relational - Operator:-

-> It is used to compare two numbers by checking whether they are equal or not, less than, less than or equal to, greater than, greater than or equal to.

-> This type of operator are use to test the relation between two variables. 


Ex:
== (Equal to)– This operator is used to check if both operands are equal.

!=  (Not equal to)– Can check if both operands are not equal.

> (Greater than)– Can check if the first operand is greater than the second.


< (Less than)- Can check if the first operand is lesser than the second.

>=  (Greater than equal to)– Check if the first operand is greater than or equal to the second.

<= (Less than equal to)– Check if the first operand is lesser than or equal to the second



*NOTE:  If the relational statement is satisfied (it is true), then the program will return the value 1, otherwise, if the relational statement is not satisfied (it is false), the program will return the value 0.

Translate

Popular Posts