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 mu of type long, initialized to a. Then, until mu is greater than edeng, subtract 2 from mu.

Solution

for (long mu = a; mu >= edeng; mu -= 2) {
    ...
}

Something to double-check in your solution:


Related puzzles: