Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 21
Medium

An algorithm is shown in the pseudo-code below:

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

Which value input by the user would result in "Green" being output by the algorithm?

333

121212

181818

272727

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms