Originally Posted by
Barney McGrew
Check the return value of scanf and handle the three cases appropriately.
How about this?
Code:
float num_check (int tester, float num_entd)
{
while((num_entd>1000) || (num_entd<0) || tester=0)
{
printf("Please enter a valid weight between 0 and 1000 lbs\n");
tester=scanf("%f", &num_entd);
}
return num_entd;
}