Skip to content · ⁨Pular para o conteúdo⁩

Count down in twos · ⁨Contar regressivamente de dois em dois⁩

English

Count down in twos

n starts at 10. Print 10, 8, 6, 4, 2 using a while loop.

The step does not have to be 1. Check where it stops: from 10 taking 2 each time, the value after 2 is 0, and 0 > 0 is false — so 0 is never printed.

Português

Contar regressivamente em dois em dois

n começa em 10. Imprima 10, 8, 6, 4, 2 usando um loop while.

O passo não precisa ser 1. Verifique onde para: de 10 tirando 2 a cada vez, o valor após 2 é 0, e 0 > 0 é falso — então 0 nunca é impresso.

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP