Hi all,
Using 'C' I need to prompt the user to enter an integer. Then I need to
check if it is between 0-18.
What is the safest approach?
I tried:
int Num;
printf("Enter a value between 0 and 18: ");
scanf("%d", &Num);
if(Num > 0 && Num <= 18)...
but that makes the app go nuts if they enter: '.4' or something stupid
like that.
Thank you in advance for any help you can offer.
Dane
|