Boolean operators
The operators which work on Boolean expressions are as follow.
Symbol | Meaning |
&& | logical and |
|| | logical inclusive or |
! | logical not (complement) |
Order of evaluation remains mostly left to right, except where rules of
precedence override this.
and &&
Takes two expressions and produces the true if both of them are true, otherwise produces false.
or ||
Takes two expressions and produces true if either has value true. If both are false, produces false.
not
This takes a single Boolean expression and reverses its value.
Exercises on this section.
Next - bit oerators.
Back to expressions.
Back to Contents page.