Add up to five · บวกถึงห้า
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.
บวกกันถึงห้า
ใช้ลูป while เพื่อบวก 1 + 2 + 3 + 4 + 5 เข้าไปใน total. total ควรจบที่ 15
สองสิ่งเปลี่ยนทุกครั้งที่วนรอบ: ผลรวมสะสม total และตัวนับ n. หากพลาดตัวนับ ลูปจะไม่จบ; หากพลาดผลรวม มันจะจบโดยไม่มีค่าอะไร
Use a while loop to add 1 + 2 + 3 + 4 + 5 into total. total should end as 15. · ใช้ลูป while เพื่อบวก 1 + 2 + 3 + 4 + 5 เข้าไปใน total. total ควรจบที่ 15
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่