Add up to five · Sumar hasta cinco
Add up to five
Use a while loop to add 1 + 2 + 3 + 4 + 5 into total. total should end as 15.
Two things change every time round: the running total, and the counter n. Miss the counter and the loop never ends; miss the total and it ends with nothing in it.
Sumar hasta cinco
Utilice un bucle while para sumar 1 + 2 + 3 + 4 + 5 en total. Al finalizar, total debe ser igual a 15.
Cada vuelta del bucle cambian dos cosas: el valor acumulado de total y el contador n. Si olvida actualizar el contador, el bucle nunca terminará; si olvida actualizar el total, este quedará vacío al final.
Use a while loop to add 1 + 2 + 3 + 4 + 5 into · dentro de total. total should end as 15. · Usa un bucle while para sumar 1 + 2 + 3 + 4 + 5 en total. total debe terminar siendo 15.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.