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 hoir of type int, initialized to 5. Then, until hoir is greater than or equal to hiw, decrement hoir.

Solution

for (int hoir = 5; hoir > hiw; hoir--) {
    ...
}

Something to double-check in your solution:


Related puzzles: