Question: Write a C program called statistics.c that prompts repeatedly for the age of a bunch of person (values of 0-120 are acceptable) until the user

 Write a C program called statistics.c that prompts repeatedly for the

Write a C program called statistics.c that prompts repeatedly for the age of a bunch of person (values of 0-120 are acceptable) until the user enters-1. Upon entering-1, the program then computes three values shown below and prints them to the screen, excluding the value of-1 from its calculation. Only use one loop in this program! Decide the appropriate data type for all variables! 1. The smallest value entered. 2 The largest value entered 3. The average value from all values entered. The program prints out the values according to the following output format: The smallest entered age is s. The largest entered age is 1. The average age is v. The variable s, v, and I need to be substituted for the corresponding computed values Here is a sample the IO of a single run. Please enter an age (0-120), enter -1 to finish: 300 Please enter an age (0-120), enter -1 to finish: 34 Please enter an age (0-120), enter -1 to finish: 5 Please enter an age (0-120), enter -1 to finish: 15 Please enter an age (0-120), enter -1 to finish:1 The amallest entered age is 15 The largest entered age is 5. The average age 19 35.67. In this sample run, the first input 300 was omitted because it is out of range 3 inputs were averaged Your program must ignore age values outsice the valild range such as pesitive values grea ter 120 or negative vaues less than

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!