Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 24
Medium

Refer to the algorithm in Figure 1.

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

Figure 1

What is the largest possible value of the variable count when the user input is 135?

333

444

555

666

Representing algorithms Questions

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