Validating user input in c advice for dating a woman with children
After the user clears the hurdle of entering integers, the program can check to see whether the values are valid.
Consider an example that requires the user to enter a lower limit and an upper limit defining a range of values.
C is a powerful language, but it will allow users to input garbage.
It is not program's fault, after all, it is only doing what it is asked to do.
Another kind of error is to enter values that are not valid for the particular task the program is doing.
Suppose, for instance, that you had a loop that processes nonnegative numbers.