Podcast
Questions and Answers
In a do-while loop, when is the test for continuation carried out?
In a do-while loop, when is the test for continuation carried out?
- At the beginning of each pass through the loop
- At the beginning and end of each pass through the loop
- Only when the loop is exited
- At the end of each pass through the loop (correct)
What is the main difference between a while loop and a do-while loop?
What is the main difference between a while loop and a do-while loop?
- The while loop may never execute, but the do-while loop always does (correct)
- The while loop executes zero or more times, but the do-while loop executes one or more times
- The while loop always executes once, but the do-while loop may never execute
- There is no difference between a while loop and a do-while loop
What happens after evaluating the control condition in a do-while loop?
What happens after evaluating the control condition in a do-while loop?
- Terminate the entire program
- Go back to step 1 and re-evaluate the control condition (correct)
- Evaluate the control condition again immediately
- Exit the loop and execute the next statement after the loop
What is guaranteed about the execution of code in a do-while loop?
What is guaranteed about the execution of code in a do-while loop?
In general form, how is a do-while loop represented in code?
In general form, how is a do-while loop represented in code?
What happens when the control condition is false in a do-while loop?
What happens when the control condition is false in a do-while loop?
Flashcards are hidden until you start studying