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
Answer and explanation
Concise answer
2, 3, 4
Why this is correct
The loop runs three times. The values output are 2, then 3, then 4, because number is increased after each output.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
