Introduction to While Loops in Programming

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering the components, structure, and behavior of while loops based on the lecture.

8 Terms

1
New cards

While loop

A programming construct that repeatedly executes a section of code as long as a specified condition remains true.

2
New cards

Looping variable initialization

Setting the starting value of the loop variable (such as setting I=0I = 0) before the while loop statement itself is written.

3
New cards

Normal brackets

The parentheses following the while keyword that enclose the condition checking whether the loop continues or stops.

4
New cards

Modulus check (I modulus 2=0I \text{ modulus } 2 = 0)

An evaluation that checks if the value of II divided by 22 leaves a remainder of 00, used to identify even numbers.

5
New cards

Increment statement (I=I+1I = I + 1)

A statement placed after the repeated code block that increases the looping variable by 11 each iteration to ensure the loop progresses toward termination.

6
New cards

Failure to increment

The omission of an increment step, which results in the variable remaining at 00 and causes the loop to never terminate.

7
New cards

Loop body

The portion of code demarcated by opening and closing braces that is repeatedly executed during the iterations of the loop.

8
New cards

Code outside the loop braces

Any statement placed outside the opening and closing braces of the while loop, which is executed only once rather than repeatedly.