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 ce of type int, initialized to 79. Then, until ce is not equal to eri, multiply ce by 3.

Solution

for (int ce = 79; ce != eri; ce *= 3) {
    ...
}

Something to double-check in your solution:


Related puzzles: