Next: Review Questions Up: The do-while statement Previous: Summary
Try to answer as many of the following Multi-choice questions as you can.
Do not panic if you make any errors. You can always start again by clicking on the "Restart" button, located at the bottom.
Please enter your full name :
What is the value of i after the do-while statement below?
i
do-while
n = 10; i = 0; do { ... i++; } while ( i < n );
9
10
11
What are the first and last values of i output by this loop?
n = 10; i = 0; do { cout << i << endl; } while ( ++i < n );
n = 10; i = 0; do { cout << i << endl; } while ( i++ < n );
Once you have completed all the questions, and are quite happy with your answers. Then click on the "Submit Answers" button.
Clicking the "Restart" button will clear all your answers, ready to re-enter them.