Boolean CS Thinking Example 3

Follow the full solution, then compare it with the other examples linked below.

Example 3

easy
What is the value of each: (a) NOT TRUE, (b) (5 < 3) OR (10 > 8), (c) (4 == 4) AND (3 > 5)?

Solution

  1. 1
    Step 1: (a) NOT TRUE = FALSE. (b) FALSE OR TRUE = TRUE.
  2. 2
    Step 2: (c) TRUE AND FALSE = FALSE.

Answer

(a) FALSE, (b) TRUE, (c) FALSE.
Combining comparison operators with logical operators (AND, OR, NOT) builds complex conditions used in program control flow.

About Boolean

A data type representing a logical value that can only be true or falseβ€”nothing else. Booleans are produced by comparison operators (==, <, >, !=) and consumed by control structures (if-statements, while-loops) to make decisions.

Learn more about Boolean β†’

More Boolean Examples