C++ Logical Operators

These operators operate on boolean values.

3 logical operators

Truth table

 

Logical AND

Evaluates to true when all operands are true. A single false operand will drag the entire expression to evaluating false.

Logical OR

Evaluates to true when at least one operand true.

A single true operand will push the entire expression to evaluating true.

NOT operator

Combining logical operators with relational operators

Output :