Skip to content · ⁨본문 바로가기⁩

Add up to five · ⁨5까지 더하기⁩

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.

한국어

5까지 더하기

while 루프를 사용하여 1 + 2 + 3 + 4 + 5을 total에 더하세요. total의 최종 값은 15이어야 합니다.

매 순환마다 두 가지가 변경됩니다: 누적 합계 total와 카운터 n입니다. 카운터를 누락하면 루프가 끝나지 않으며, 총계를 누락하면 비어 있는 상태로 끝납니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP