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 umo of type int, initialized to 54. Then, until umo is less than or equal to ang, multiply umo by 3.

Solution

for (int umo = 54; umo < ang; umo *= 3) {
    ...
}

Something to double-check in your solution:


Related puzzles: