1/7
Vocabulary flashcards covering the components, structure, and behavior of while loops based on the lecture.
While loop
A programming construct that repeatedly executes a section of code as long as a specified condition remains true.
Looping variable initialization
Setting the starting value of the loop variable (such as setting I=0) before the while loop statement itself is written.
Normal brackets
The parentheses following the while keyword that enclose the condition checking whether the loop continues or stops.
Modulus check (I modulus 2=0)
An evaluation that checks if the value of I divided by 2 leaves a remainder of 0, used to identify even numbers.
Increment statement (I=I+1)
A statement placed after the repeated code block that increases the looping variable by 1 each iteration to ensure the loop progresses toward termination.
Failure to increment
The omission of an increment step, which results in the variable remaining at 0 and causes the loop to never terminate.
Loop body
The portion of code demarcated by opening and closing braces that is repeatedly executed during the iterations of the loop.
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.