← Cambridge IGCSE

Boolean logic: Cambridge IGCSE practice

AND, OR, NOT, truth tables and gates. 12 questions in the style of the Cambridge IGCSE exam.

Sample questions

What is the value of `True and False`?

  1. True
  2. False
  3. None
  4. An error

Write a program that reads two whole numbers, one per line. Print `Both positive` if both are greater than 0, `One positive` if exactly one is greater than 0, and `None positive` otherwise.

A NAND gate has inputs A = 1 and B = 1. What is the output?

  1. 0
  2. 1
  3. It depends on the previous output
  4. 2