1/21
Comprehensive vocabulary flashcards reviewing fundamental loop structures, execution flow, control statements, and common errors in C programming.
Loop
A programming structure that repeatedly executes a block of code as long as a specified condition remains true.
Loop Body
The block of repeated statements located between braces inside a loop.
Iteration
A single complete execution of a loop body.
Loop Counter
A variable dedicated to tracking and counting the number of iterations executed by a loop.
Initialization (Loop)
The initial step in a loop construct that assigns the starting value to the loop counter, executed only once before any iteration begins.
Update Expression
The statement executed during or after each iteration that modifies the loop counter (e.g., i++ or i–) to make progress toward terminating the loop.
Condition (in C)
An expression evaluated to determine loop continuation, where a value of 0 represents false and any non-zero value represents true.
Infinite Loop
A loop whose condition never evaluates to false—often due to an omitted or incorrect update—causing the loop to execute indefinitely until externally stopped.
Pre-test Loop
A loop type (such as for or while) that evaluates its controlling condition before executing the body, running zero times if the condition is initially false.
Post-test Loop
A loop type (such as do−while) that executes its body first before evaluating the condition, guaranteeing that the body runs at least once.
for Loop
A loop structure that consolidates initialization, condition checking, and counter update into a single header, best suited when the number of iterations is known in advance.
while Loop
A pre-test loop construct that repeats its body as long as its condition remains true, typically chosen when the total iteration count is unknown beforehand.
do-while Loop
A post-test loop construct that executes the body first and tests the condition at the end, requiring a mandatory semicolon after the closing parenthesis (while(condition);).
Sentinel Value
A designated special input value (such as 0 or −1) used to signal the end of data entry and terminate a condition-controlled loop without being processed as valid data.
break Statement
A jump statement that causes an immediate exit from the innermost loop (or switch) currently executing, bypassing the remaining body statements and update steps.
continue Statement
A jump statement that halts the current iteration of a loop and moves execution directly to the next iteration (resuming at the update in a for loop, or at the condition in a while loop).
Off-by-One Error
A logic error that occurs when a loop executes one time too many or one time too few, commonly caused by confusing relational operators such as < and ≤.
Nested Loop
A loop enclosed inside the body of another loop, where the complete inner loop executes from start to finish for each single iteration of the outer loop.
Flag Variable
A variable (commonly storing 0 or 1) used to indicate whether a specific event or condition, such as finding a target element in a search, has occurred.
Postfix Increment (i++)
An operator that yields the current value of the variable in an expression first, and then increments the variable by 1.
Prefix Increment (++i)
An operator that increments the variable by 1 first, and then yields the resulting value for use in the expression.
scanf_s
A security-enhanced standard input function used in Visual Studio that prevents buffer overflows by requiring explicit buffer sizes for character and string conversions, returning the number of successfully assigned inputs.