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 iss of type long, initialized to ar. Then, until iss is greater than or equal to flena, multiply iss by 2.

Solution

for (long iss = ar; iss > flena; iss *= 2) {
    ...
}

Something to double-check in your solution:


Related puzzles: