...

/

Comparison Operators

Comparison Operators

Let’s learn about the comparison operator used in C++.

As the name implies, conditional statements specify whether another statement or block of statements should be executed or not. These are often called selection constructs. The two general types are:

  • “if…else”

  • "switch…case”

Comparison operators

The conditions tested are specified using comparison operators, also called relational operators. These operators cause the immediate statement in which they are contained to return a boolean value of either true or false.

<variable_type> <operator> <variable_name>

Note: In certain circumstances they may ...