C-programming - Relational operator, C++ relational operator

Relational operator

relational operator defines some kind of relation between two entities.The relational operators in c++ are == (equal to), != (Not equal to), < (Less than), > (greater than), <= (less than or equal to), >= (greater than or equal to).The result of a relational operator is either 0 or 1.



 #include <iostream.h>
  int main( )
    {
      int a = 50;
      int b = 100;
      clrscr ();
      cout << " a is less than b is " << (a<b) << endl;
      cout << " a is greater than b is " << (a>b) << endl;
    }


Output


a is less than b is 1
a is greater than b is 0

The topic on C-programming - Relational operator is posted by - Malar

Hope you have enjoyed, C-programming - Relational operatorThanks for your time

Tech Bluff