UMBC CMSC 201 Spring '02 | CSEE | 201 | 201 S'02 | lectures | news | help |
For example
If the value is not 2 or not 3 then ...if translated literally from English, becomes :
if ((v != 2) || (v != 3)) ...which is ALWAYS TRUE
what we really want is:
if ((v != 2) && (v != 3)) ...
You can always use some tautologies to simplify things.