Exam-style question
Try this first
What is output by this pseudocode? number <- 2 REPEAT 3 TIMES OUTPUT number number <- number + 1 END REPEAT.
- A.2, 2, 2
- B.2, 3, 4
- C.3, 4, 5
- D.2, 3
Model answer
What a good answer should say
- 2, 3, 4
Explanation
Why this works
The loop runs three times. The values output are 2, then 3, then 4, because number is increased after each output.
Common mistake
No common mistake is linked to this question yet.
