Relational Operators in C++
C++ Relational operators are used to compare two values or expressions, and based on this comparison, it returns a boolean value (either true or false) as the result. Generally false is represented as 0 and true is represented as any non-zero value (mostly 1).
How to use Relational Operator?
All C++ relational operators are binary operators that are used with two operands as shown:
operand1 relational_operator operand2
expression1 relational_operator expression2
C++ Relational Operators
In C++ programming language, we sometimes require to compare values and expressions. This comparison allows us to determine relationships, make decisions, and control the flow of our programs. The relational operators in C++ provide the means to compare values and evaluate conditions.
In this article, we will learn about C++ relational operators and understand their significance in making logical comparisons in code.