1/19
This set of flashcards covers vocabulary and key concepts from the lecture on C programming control statements, including conditional statements, loops, and jump statements.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
if Statement
A conditional statement that executes a block of code based on a condition; if the condition is true, the block is executed, otherwise it is skipped.
if-else Statement
A conditional statement used to execute the if block if the condition is true, otherwise the else block will be executed.
if-else if-else Statement
A control structure used to check multiple conditions in sequence, where each block is checked only if the previous conditions were false.
switch Statement
A control structure that allows the selection of one of many code blocks based on the evaluated value of an expression.
break Statement
A statement used to exit a loop prematurely, even if the loop's condition is still true, or to prevent fall through in a switch statement.
default case
An optional portion of a switch statement that executes if none of the case labels match the expression.
Fall through
A behavior in switch statements where execution continues to the next case because a break statement was omitted.
Nested conditional statements
The use of one or more conditional statements, such as if, else if, or else, inside the body of another conditional statement.
for loop
A loop used for repetitive execution when the number of iterations is known in advance, consisting of initialization, condition, and increment/decrement.
Initialization
The part of a for loop, executed only once at the beginning, used to set the starting value for loop control variables.
Condition
A Boolean expression evaluated before each loop iteration to determine if the loop should continue or terminate.
Increment/Decrement
The part of a for loop executed at the end of each iteration to modify the loop control variable toward the termination condition.
while loop
A control structure used for repetitive execution as long as a certain condition is true, typically used when the number of iterations is not known in advance.
Infinite Loop
A loop where the condition never becomes false, such as when a variable like i is always 1, causing the program to never terminate.
do-while loop
A repetitive control structure that guarantees the code inside the loop is executed at least once because the condition is checked after the execution of the loop body.
Nested Loop
The use of one or more loops, such as for, while, or do-while, inside another loop, often used for multi-dimensional data structures like matrices.
continue Statement
A statement used to skip the current iteration of a loop and immediately proceed to the next iteration.
goto Statement
A statement used to transfer program control to a specific labeled statement within the same function, creating non-linear control flow.
Single-Line Statement Format
A concise format where control statements are written on a single line without enclosing the code block in curly braces , used for simple one-liner statements.
Multi-Line Statement Format
A format where control statements are enclosed within curly braces to group multiple statements, enhancing readability for complex logic.