This content High School is for students. You are viewing this as a preview; to see content suitable for your group and save your progress, Log inSign up
Sign up for free Create an account for quizzes, points system, and more.
Solved Problem Intermediate Grade 10 Mathematics 5. Counting, Algorithm and Informatics

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"?

  1. 15
  2. 25
  3. 30
  4. 55
  5. 36
Solve the unit test for this question

Solution

1 + 4 + 9 + 16 + 25 = 55.

Answer: D
All Questions