While loops and for loops: Correct Solution


Part 1

Translate the following natural language description of a loop into a for loop:

Declare a variable named oi of type int, initialized to 30. Then, until oi is less than or equal to eap, multiply oi by 4.

Solution

for (int oi = 30; oi < eap; oi *= 4) {
    ...
}

Something to double-check in your solution:


Related puzzles: