We use the NOT operator to reverse or negate a condition. If the condition is true, NOT will return false and viceversa. In some programming languages NOT operator is denoted by “!” symbol.
Unlike the previous examples, here we have only one condition.
Condition: Is it raining?
Decision: Go out to play?
The pseudocode for this will look like below:
IF NOT (It is raining)
THEN
Go out to play
ELSE
Stay indoors
END
And the corresponding table for this is below.
Is it raining? |
Go out to play? |
Yes |
No |
No |
Yes |