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 acto of type int, initialized to 47. Then, until acto is less than or equal to noBic, subtract 2 from acto.

Solution

for (int acto = 47; acto < noBic; acto -= 2) {
    ...
}

Something to double-check in your solution:


Related puzzles: