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 coc of type int, initialized to 11. Then, until coc is less than nir, decrement coc.

Solution

for (int coc = 11; coc <= nir; coc--) {
    ...
}

Something to double-check in your solution:


Related puzzles: