Mega Code Archive

 
Categories / C Tutorial / Statement
 

Read number in a range

#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