write a program
1. Prompts the user to enter a number in the range of 1 to 255 from the keypad.
2. Waits for a user to enter a number in the range.
#include<stdio.h>
int main(){
int number=-1;
while(number<1 || number>255){
printf("Enter a number in the range of 1 to 255: ");
scanf("%d",&number);
}
printf("The number is: %d\n\n",number);
getchar();
getchar();
return 0;
}
Comments
Leave a comment