AQA GCSE · Question 02.1 · Fundamentals of algorithms
Figure 2 shows an algorithm that uses integer division which has been represented using pseudo-code. Line numbers are included but are not part of the algorithm.
Figure 2
1 again ← True
2 WHILE again = True
3 a ← USERINPUT
4 IF a > 0 THEN
5 counter ← 0
6 WHILE a > 0
7 a ← a DIV 3
8 counter ← counter + 1
9 ENDWHILE
10 ELSE
11 again ← False
12 ENDIF
13 OUTPUT a
14 ENDWHILE
Where is iteration first used in the algorithm in Figure 2?
Answer options:
Line number 2
Line number 4
Line number 6
Line number 11
31 questions · hints · full answers · grading