1 of 6

Boolean Operator- NOT

2 of 6

  • Boolean Operator NOT is called Negation Operator because it inverts (or negates) a condition. It turns YES to NO and NO to YES.

Truth Table

  • NOT operator is called as Unary Operator because it takes single input value

A

Not A

True

False

False

True

Yes

No

No

Yes

3 of 6

  • The NOT operator can be used in the following two ways:
    1. When we have a condition and want to tell the computer what to do if the opposite happens.
    2. When a word to describe the exact opposite does not exist.

4 of 6

A

B

A (AND) B

Pass

Pass

Pass

Pass

Fail

Fail

Fail

Fail

Fail

Fail

Pass

Fail

Truth Table for Boolean Operator AND

  1. If both the conditions (conditionA and conditionB) are TRUE, the result will be TRUE.
  2. If one of the conditions (either ConditionA or ConditionB) is FALSE, the result will be FALSE.
  3. If both the conditions are FALSE, the result will be FALSE.

5 of 6

A

B

A (OR) B

True

True

True

True

False

True

False

False

False

False

True

True

Truth Table for Boolean Operator OR

  1. If both the conditions (conditionA and condition) TRUE, the result will be TRUE.
  2. If one of the conditions (either ConditionA or ConditionB) is FALSE, the result will be TRUE.
  3. IF both the conditions are FALSE, the result will be FALSE.

6 of 6

  • Operators AND and OR are used when there are two input values.

Example: ConditionA and ConditionB

  • AND returns TRUE when both the input values are TRUE.
  • OR returns TRUE when both the input values are TRUE and when one of the input values is TRUE