Relational Operator

The relational operator in C are mostly used for comparison purpose of two values of two expressions. Those expressions which use relational operators are also known as relational expressions.

Following are the relational operator in C :


  • The relation operators are mostly used in looping and control statements (if…..else) .The relations operators >,<,<=,>= have the same precedence. The operator == and != have just low precedence then above mentioned operators.
  • Relational operators have low precedence as comparison to arithmetic operators. So while using these operators in any expression or inside looping precedence must be taken care of.
  • Logical operators in C results in numeric value of 1 and 0 for its expression for true and false respectively (every non zero values are considered to be true in C whereas 0 is considered as false) .

The code given below will clear you more about relational operator:

Program compiled in Code::Blocks compiler.




Output on  program for two different numbers

Output of program for two same numbers

Operators are most important topics for asking questions in IT Quiz Competition.
To check your command in Operators visit Online Test powered by Quick Solution.

Click here to go program gallery of Quick Solution.

Leave a Reply