“And” and “or” (cont.)
n
Consider:
n
(5 == 4) && ????
n
(5 != 4) || ????
n
Does it matter what the second operands
are?
n
This can protect against runtime errors
such as an attempt to divide by zero.
n
Example:
(x == 0) || (y/x < 10)
n
(x != 0) && (y/x < 10)