Read number in a range : Do While « Statement « C Tutorial






#include <stdio.h>

int main(){


    printf("Please enter the number to start\n");
    printf("the countdown (1 to 100):");

    int start;
    scanf("%d",&start);
    do {
      printf("%d",start);
    }while(start<1 || start>100);
}
Please enter the number to start
      the countdown (1 to 100):12
      12








6.8.Do While
6.8.1.The do...while loop
6.8.2.Reversing the digits: do while loop
6.8.3.Read number in a range
6.8.4.Nest for loop inside do while loop