Count down in twos · Cuenta regresiva de dos en dos
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.
Cuenta regresiva de dos en dos
n comienza en 10. Imprime 10, 8, 6, 4, 2 utilizando un bucle while.
El paso no tiene por qué ser 1. Observa dónde se detiene: partiendo de 10 y restando 2 en cada iteración, el valor posterior a 2 es 0, y como 0 > 0 es falso —entonces 0 nunca se imprime—.
n starts at 10. Print 10, 8, 6, 4, 2 using a while loop. · n comienza en 10. Imprime 10, 8, 6, 4, 2 usando un bucle while.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.