Quiz questions and exercises to test your understanding and to stretch your skills.
What command forces the cancellation of a loop and moves code operation to the statement after the closing brace?
Which of the following is likely to cause an infinite loop to occur?
The wrong sort of loop has been used.
The condition to terminate the loop is never met.
There are too many statements in the loop.
If no specified case is matched in a switch statement,
An error will be generated.
The optional default case will execute, if one is present.
The obligatory default case is executed.
The statements in a do ... while clause
Will always be executed at least once
May be executed zero or more times
Will continue to be executed until a break statement is encountered
a. The break command ends loop execution.
b. An infinite loop occurs if the condition to terminate the loop is never met.
b. The optional default case will execute, if one is present.
a. The statements in a do ... while clause will always be executed at least once.