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. · לחץ על הרץ כדי לראות את התוצא כאן.