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?
- 5
- 6
- 7
- 32
- 64
Solution
64 → 32 → 16 → 8 → 4 → 2 → 1: 6 steps.