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 ra of type int, initialized to 78. Then, until ra is less than jiche, multiply ra by 4.

Solution

for (int ra = 78; ra <= jiche; ra *= 4) {
    ...
}

Something to double-check in your solution:


Related puzzles: