Skip to content · ⁨דלג לתוכן⁩

Loops: while, for, and accumulation · ⁨לולאות: while, for ואיסוף⁩

English

Repeating work

  • A loop runs the same block of code many times, so you don't copy it by hand.
  • C has three loops: while, for, and do-while. They all repeat while a condition is true.
  • The condition is checked each time around. When it becomes false, the loop stops.
עברית

חזרה על פעולה

  • לולאה מריצה את אותה חוסמת קוד מספר פעמים רבות, כך שאין צורך להעתיק אותה ידנית.
  • ל-C יש שלוש לולאות: while, for, וdo-while. כולן חוזרות על עצמן כל עוד תנאי נכון.
  • התנאי נבדק בכל סיבוב. כאשר הוא הופך לא נכון, הלולאה נעצרת.

Handout · ⁨חומר עזר⁩

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP