Add up to five · Additionnez jusqu'à cinq
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.
Additionner jusqu'à cinq
Utilisez une boucle while pour ajouter 1 + 2 + 3 + 4 + 5 à total. total doit se terminer en tant que 15.
Deux choses changent à chaque tour : le total courant total, et le compteur n. Manquer le compteur et la boucle ne finira jamais ; manquer le total et il se terminera sans rien dedans.
Use a while loop to add 1 + 2 + 3 + 4 + 5 into · dans total. total should end as 15. · Utilisez une boucle while pour ajouter 1 + 2 + 3 + 4 + 5 à total. total doit se terminer en tant que 15.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.