A while that tests inputCompare with do-while
printf (“Enter a positive number: “);
scanf (“%d”, &num);
while (num <= 0)
{
printf (“\nThat is not positive, try again\n”);
printf (“Enter a positive number: “);
scanf (“%d”, &num);
}
Previous slide
Next slide
Back to first slide
View graphic version