Skip to content · ⁨Passer au contenu⁩

Add up to five · ⁨Additionnez jusqu'à cinq⁩

English

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.

Français

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.

Log in or create account · ⁨Se connecter ou créer un compte⁩

IGCSE, A-Level & AP