Podcast
Questions and Answers
What is the general format of the while loop?
What is the general format of the while loop?
- while {expression} statement;
- while (expression) { statement; }
- while (statement) { expression; }
- while (expression) statement; (correct)
When is the expression in a while loop evaluated?
When is the expression in a while loop evaluated?
- Before each execution of the statement (correct)
- After each execution of the statement
- Only once at the beginning of the loop
- At the end of the loop
What kind of loop is the while loop?
What kind of loop is the while loop?
- Conditional loop
- Post-test loop
- Infinite loop
- Pretest loop (correct)
In a while loop, what happens if the expression is false?
In a while loop, what happens if the expression is false?
What will happen if no change occurs to the condition in a while loop?
What will happen if no change occurs to the condition in a while loop?