Skip to main content

Practice ยท 2 of 3

Halving Loop

CHALLENGE
Difficulty: beginner+25 XP

n = 40 is given. Print n after each halving (40, 20, 10, 5, 2) while it is at least 2 โ€” using integer division and a while loop.

Back to lesson: Practice: while & Game Logic