Question: Write a C program to display the names of 5 states as shown below, identified with numbers 1-5. 1. Ohio 2.Illinois 3.Maryland 4.California 5.Florida Follow

Write a C program to display the names of 5 states as shown below, identified with numbers 1-5.

1. Ohio

2.Illinois

3.Maryland

4.California

5.Florida

Follow the steps below to read populations of the 5 states, find the average population of the states, and print the average population.

1.Request a number between 1 and 5. If the entered number is not between 1 and 5, repeat this step until a valid number is entered.

2.Prompt the user for the population of the state, which should be between 1 million to 15 million. If the entered population is outside the range, repeat this step until a valid population is entered.

3. If the population of a state is entered more than once, use the last entered population.

4.Use a while loop to read valid populations for all 5 states. Then, find the average population of the states and display the average population.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!