Translate the following natural language description of a loop into a for loop:
Declare a variable namedtreof typeint, initialized to29. Then, untiltreis greater than or equal togli, dividetreby3.
for (int tre = 29; tre > gli; tre /= 3) {
...
}
Something to double-check in your solution:
tre > gli)?Related puzzles: