Do-While Example
Do {
printf("Enter a "
"positive integer: ");
scanf("%d", &response);
} while (response <= 0);
Check for the validity of user input (must be positive). If the input is invalid, the user is prompted again to enter a value.
Previous slide
Next slide
Back to first slide
View graphic version