Microsoft
98-361 · Question #45
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 C. 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
- BWhile
- CDo,,While
- DFor. ,,Each
How the community answered
(56 responses)- A5% (3)
- B7% (4)
- C70% (39)
- D18% (10)
Explanation
In a Do..While loop the test is at the end of the structure, so it will be executed at least once.
Topics
#do-while loop#loop structures#guaranteed execution#iteration
Community Discussion
No community discussion yet for this question.