C++ Relational Operators

The C++ relational operators are used to compare two values. Here are the relational operators in C++:

  1. "==" (Equal to): This operator checks if two values are equal. It returns true if the values are equal, and false otherwise.

  2. "!=" (Not equal to): This operator checks if two values are not equal. It returns true if the values are not equal, and false otherwise.

  3. ">" (Greater than): This operator checks if the left-hand side value is greater than the right-hand side value. It returns true if the left-hand side value is greater, and false otherwise.

  4. "<" (Less than): This operator checks if the left-hand side value is less than the right-hand side value. It returns true if the left-hand side value is less, and false otherwise.

  5. ">=" (Greater than or equal to): This operator checks if the left-hand side value is greater than or equal to the right-hand side value. It returns true if the left-hand side value is greater than or equal to, and false otherwise.

  6. "<=" (Less than or equal to): This operator checks if the left-hand side value is less than or equal to the right-hand side value. It returns true if the left-hand side value is less than or equal to, and false otherwise.