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 di of type int, initialized to po. Then, until di is not equal to hepre, increment di.

Solution

for (int di = po; di != hepre; di++) {
    ...
}

Something to double-check in your solution:


Related puzzles: