Double until it passes 100 · Dobrar até passar de 100
Double until it passes 100
n starts at 1. Keep doubling it while it is 100 or less. Store the first value over 100 in n.
Here the value being tested is the value being changed, so the loop needs no separate counter. It stops the moment the question turns false — and n keeps the value that made it false.
Dobrar até passar de 100
n começa em 1. Continue dobrando enquanto estiver ≤ 100. Armazene o primeiro valor > 100 em n.
Aqui o valor testado é o valor alterado, então o loop não precisa de contador separado. Para no momento em que a condição fica falsa — e n guarda o valor que a tornou falsa.
n starts at 1. Keep doubling it while it is 100 or less. Store the first value over 100 in n. · n começa em 1. Continue dobrando enquanto estiver ≤ 100. Armazene o primeiro valor > 100 em n.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.