Skip to content · ⁨Lompat ke konten⁩

Count up to five · ⁨Hitung naik hingga lima⁩

English

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.

Bahasa Indonesia

Hitung hingga lima

Gunakan perulangan while untuk mencetak 1 hingga 5, satu per baris. Mulai n dari 1.

Menghitung naik membutuhkan n = n + 1 alih-alih n - 1, dan sebuah pertanyaan yang berhenti pada tempat yang tepat. n <= 5 mengizinkan 5 lewat; n < 5 akan menghentikan terlalu dini.

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP