Practice Boolean Logic in CS Thinking

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

A system of logic that works with only two possible values—true and false—combined using the operators AND, OR, and NOT. Boolean logic provides the mathematical foundation for all decision-making in computing, from simple if-statements to complex database queries and digital circuit design.

Yes/no thinking. You combine simple true/false conditions into complex decisions with AND, OR, NOT.

Showing a random 20 of 50 problems.

Example 1

easy
Fill in the missing rows of A OR B: (T,T)→?, (T,F)→?, (F,T)→?, (F,F)→?.

Example 2

easy
Evaluate: true AND false.

Example 3

easy
Evaluate: true AND true.

Example 4

challenge
Find a single assignment of A, B, C that makes (A OR NOT B) AND (NOT A OR C) AND (B OR NOT C) FALSE.

Example 5

medium
Evaluate: NOT (false OR true).

Example 6

challenge
Build the truth table value: for how many of the 4 rows of (A AND B) is the result true?

Example 7

easy
Evaluate: NOT false.

Example 8

medium
Evaluate using precedence: TRUE OR FALSE AND FALSE.

Example 9

easy
Evaluate: TRUE AND TRUE AND FALSE.

Example 10

medium
Evaluate: (true OR false) AND (NOT false).

Example 11

hard
Short-circuit trace: in code 'if (x != 0) AND (10 / x > 1)' with x = 0, does division by zero occur?

Example 12

medium
Evaluate: NOT (A AND B) where A=TRUE, B=FALSE, then verify using De Morgan.

Example 13

medium
Evaluate: (true AND false) OR true.

Example 14

medium
Trace the access condition: allow = (isMember AND NOT banned) OR isAdmin. For isMember=TRUE, banned=TRUE, isAdmin=FALSE, does access succeed?

Example 15

easy
How many rows does the truth table for 3 boolean variables have?

Example 16

medium
For (A AND B) OR (NOT A AND C) with A=FALSE, B=TRUE, C=TRUE, the value is ____.

Example 17

medium
For how many of the 8 rows of (A OR B) AND C is the result TRUE?

Example 18

easy
Evaluate: NOT true.

Example 19

medium
Evaluate: (5 > 3) AND (2 > 4).

Example 20

medium
For variables A, B, C the expression is A AND (B OR C). With A=TRUE, B=FALSE, C=TRUE, evaluate.