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 cof of type double, initialized to 53. Then, until cof is less than cesm, add 2 to cof.

Solution

for (double cof = 53; cof <= cesm; cof += 2) {
    ...
}

Something to double-check in your solution:


Related puzzles: