Next: Review Questions Up: The 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 while statement below?
i
while
n = 10; i = 0; while ( i < n ) { ... i++; }
9
10
11
What are the first and last values of i output by this loop?
n = 10; i = 0; while ( ++i < n ) { cout << i << endl; }
n = 10; i = 0; while ( i++ < n ) { cout << i << endl; }
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.