Boolean Research
According to my online research, I found that there are six logical, or boolean, operators. They are:
-
AND ( & ) Returns true if both of the operands evaluate to true. Both operands are evaluated before the And operator is applied.
-
conditional AND ( && ) Same as &, but if the operand on the left returns false, it returns false without evaluating the operand on the right.
-
OR ( | ) Returns true if at least one of the operands evaluates to true. Both operands are evaluated before the Or operator is applied.
-
conditional OR ( || ) Same as |, but if the operand on the left returns true, it returns true without evaluating the operand on the right.
-
exclusive OR ( ^ ) Returns true if one — and only one — of the operands evaluates to true. Returns false if both operands evaluate to true or if both operands evaluate to false.
-
NOT ( ! ) Returns true if the operand to the right evaluates to false. Returns false if the operand to the right is true.
Truth Table
The truth table shows all possible combinations of the
variables showing the relation between the values that
variables may take and the result of the operation.