Explore BrainMass

A c program to read valid integer values

I need this program to not accept a negative birth rate, negative death rate, or a population less than 2.
Please see the attached file.


Solution Preview

The best way to accomplish this is to create a private method that will read in the values and do the appropriate validation. For the purposes of this problem it makes sense to specify the prompt and the lowest acceptable value. A method ...

Solution Summary

This solution demonstrates how to write a C program that reads in integer values until a valid value has been entered. The program shows how to use functions to create a better structured program.