Not-Equal (!=) Operator in C++
The not-equal operator(!=) evaluates two values and returns a boolean value.
- It returns true when both values are not equal.
- It returns false if they are equal
The not equal to the operator is a binary operator so it is used with the two operands:
operand1 != operand2
It only allows for branching when both values are different and can be used to make decisions based on a given condition.
How to Use the Not-Equal (!=) Operator in C++?
The not-equal operator is a fundamental comparison operator in C++ represented by “!=”. It is used for making decisions in programming and is hence called a conditional operator. In this article, we will discuss how to use the Not-Equal (!=) operator in C++.