User interface language: English | Español

Date May 2021 Marks available 3 Reference code 21M.1.SL.TZ0.8
Level SL Paper 1 Time zone no time zone
Command term List Question number 8 Adapted from N/A

Question

List the output from the given algorithm for the following input. 

2, 6, 8, 9, 12, 15, 18, 20

loop for Count from 0 to 7
input NUMBER
if NUMBER div 2 = NUMBER / 2 then
if NUMBER div 3 = NUMBER / 3 then
output NUMBER
end if
end if
end loop

Markscheme

Award [3 max]
6;
12;
18;

Examiners report

Candidates were generally able to dry run the given algorithm and give the values of the various calculations, but unfortunately, not everyone identified the values that would actually be output, namely those divisible by both 2 and 3, but instead listed all the numbers from the input. The full range of marks was seen for this question.

Syllabus sections

Topic 4: Computational thinking, problem-solving and programming » 4.2 Connecting computational thinking and program design
Show 59 related questions
Topic 4: Computational thinking, problem-solving and programming

View options