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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started