Grade 10 Mathematics 5. Theme · Question 9: Of the algorithm "s ← 0; i ← 1; while i ≤ 5: s ← s + i·i; i ← i + 1; print s"…
Source: Raista (original, based on textbook learning outcomes)
Question
What is the output of the algorithm "s ← 0; i ← 1; while i ≤ 5: s ← s + i·i; i ← i + 1; print s"?
- 15
- 25
- 30
- 55
- 36
Solution
1 + 4 + 9 + 16 + 25 = 55.