C Control Flow Flashcards
What is the default block in a C switch statement
a case block that is used to catch any input that does not match the case statements
C Control Flow: switch
Switch is a control flow statement that enables you to choose one course of action from a set of possible actions, based on the result of an integer expression
C Control Flow: do while
do while is a loop that executes a block of statements, then checks a condition and if it is true, the block is repeated, otherwise it will skip to the next statement after the condition
What three expressions does a C for loop contain
variable initialization, conditional expression, loop control variable expression
What does the break statement do in a C loop
It terminates the loop and program control returns to the next statement following the end of the loop
What does the continue statement do in a C loop
forces the next iteration of the loop and passes over any remaining statements within the loop
What is the controlling expression in a C switch statement
a constant integer expression followed by the switch keyword and is compared with each of the case labels
What is the body of a C switch statement enclosed in
Curly braces
C Control Flow: goto
Goto is a control flow statement that directs the flow of execution to a labelled block of code
What must the controlling expression be followed by in a C switch statement
A colon :
What does the break statement do in a C switch case block
skip over the other statements within that case and continue with whatever statement follows the closing brace
What is a continuation condition in C loops
A condition in a loop that is checked before each iteration to see whether the loop should continue
When does a C loop terminate
When the control expression evaluates to false
C Control Flow: for
For is a loop that executes a block of statements a given number of times
What are control expressions in C loops
conditions that control the operation of a loop