Translate the following natural language description of a loop into a for loop:
Declare a variable namedsahiof typeshort, initialized toiali. Then, untilsahiis greater thanmaidi, multiplysahiby2.
for (short sahi = iali; sahi >= maidi; sahi *= 2) {
...
}
Something to double-check in your solution:
sahi >= maidi)?Related puzzles: