Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 45
Medium

An algorithm is shown in the pseudocode below:

1  keepGoing ← True
2  WHILE keepGoing = True
3      val ← USERINPUT
4      IF val > 1 THEN
5          count ← 0
6          WHILE val > 1
7              val ← val DIV 2
8              count ← count + 1
9          ENDWHILE
10         OUTPUT count
11     ELSE
12         keepGoing ← False
13     ENDIF
14 ENDWHILE

What will be the first value output when the user inputs 18?

333

444

555

999

Representing algorithms Questions

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