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 o of type int, initialized to pei. Then, until o is less than or equal to gasm, increment o.

Solution

for (int o = pei; o < gasm; o++) {
    ...
}

Something to double-check in your solution:


Related puzzles: