Codington
0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Grow Until the Goal

A condition-controlled loop is useful when the important part is reaching a goal rather than repeating a named number of times.

Your task

Start with seats equal to 1. Use a while loop to double it until it reaches at least 16, then display Seats: 16.

Hint

Describe the stopping point in terms of the current seat count.