Microsoft
98-361 · Question #192
You are creating a routine that will perform calculations by using a repetition structure. You need to ensure that the entire loop executes at least once. Which looping structure should you use?
The correct answer is D. Do-While. In a Do..While loop the test is at the end of the structure, so it will be executed at least once.
Understanding Core Programming
Question
You are creating a routine that will perform calculations by using a repetition structure. You need to ensure that the entire loop executes at least once. Which looping structure should you use?
Options
- AFor-Each
- BFor
- CWhile
- DDo-While
How the community answered
(53 responses)- A6% (3)
- B13% (7)
- C4% (2)
- D77% (41)
Explanation
In a Do..While loop the test is at the end of the structure, so it will be executed at least once.
Topics
#looping structures#do-while loop#control flow#iteration
Community Discussion
No community discussion yet for this question.