Skip to content · ⁨Перейти к содержанию⁩

Count up to five · ⁨Считать вверх до пяти⁩

Count up to five

Use a while loop to print 1 to 5, one per line. Start n at 1.

Counting up needs n = n + 1 instead of n - 1, and a question that stops at the right place. n <= 5 lets 5 through; n < 5 would stop one early.

Log in or create account · ⁨Войти или создать аккаунт⁩

IGCSE, A-Level & AP