Another Do While Example
#include <iostream.h>
void main()
{
int x = 0;
do
{ cout << ”Enter a number between 0 and 9:";
cin >> x;
} while (x < 0 || x > 9);
cout << "You entered " << x << endl;
}
Previous slide
Next slide
Back to first slide
View graphic version