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 ec of type int, initialized to 26. Then, until ec is less than or equal to adDirad, subtract 4 from ec.

Solution

for (int ec = 26; ec < adDirad; ec -= 4) {
    ...
}

Something to double-check in your solution:


Related puzzles: