Boolean Operator in C : Logic Operators « Operator « C Tutorial

Character SetBoolean Operator

&& Operator

  1. && operator: evaluate a Boolean expression from left to right.
  2. Both sides of the operator must evaluate to true before the entire expression becomes true.

|| Operator

  1. || operator: evaluate from left to right.
  2. If either side of the condition is true, the whole expression results in true.

5.5.Logic Operators
5.5.1.Boolean Operator in C
5.5.2.Logical operator
5.5.3.Logical AND (&&) returns a true value if both relational expressions are true.
5.5.4.Short circuiting
5.5.5.Ternary operator
5.5.6.Testing letters with logic operator and (&&)
5.5.7.The || is the logical OR operator.