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 10: In the algorithm "x ← 64; while x > 1: x ← x / 2; counter ← counter + 1", starting from counter 0…

Source: Raista (original, based on textbook learning outcomes)

Question

What is the final value of the counter in the algorithm "x ← 64; while x > 1: x ← x / 2; counter ← counter + 1" if the counter starts at 0?

  1. 5
  2. 6
  3. 7
  4. 32
  5. 64
Solve the unit test for this question

Solution

64 → 32 → 16 → 8 → 4 → 2 → 1: 6 steps.

Answer: B
All Questions