Skip to content
MathsGenie logo
Open app

Course home

  1. GCSE
  2. Computer Science AQA
  3. Question bank

Programming concepts

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637
Question 14

Which value input by the user would result in "Blue" being output by the algorithm shown below?

1      val ← USERINPUT
2      IF NOT(val < 30) OR val < 5 THEN
3          OUTPUT "Red"
4      ELSEIF val >= 5 AND val < 12 THEN
5          OUTPUT "Green"
6      ELSEIF val MOD 3 = 0 THEN
7          OUTPUT "Blue"
8      ELSE
9          OUTPUT "Yellow"
10     ENDIF

333

999

151515

333333

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts