Question: Write a program which prompts the user to enter the number of values to process (a maximum of 100). Next prompt, and allow the user

Write a program which prompts the user to enter the number of values to process (a maximum of 100). Next prompt, and allow the user to enter each of the values. Store these values in an array. Print the largest value, the smallest value, and the average (to 2 decimal places) of the values in the array. You must use functions for each of these tasks. The GetValues() function is the only function that may change the array.  Write a program which prompts the user to enter the number

0Rte a program which prompts the user to enter the number of values to process tore these values in an array. Print the largest value, the smallest value, and the average (to 2 decimal places) of the values in the array. You must use functions for each of these tasks. The due: see http llece160.org (a maximum of 100). Next prompt, and allow the user to enter each ot the values change the array The prototypes for the functions must be: GetValues() function is the only function that may void GetValues (int x[l,int pa) int FindBig (int xl, int n); int FindSml (int xl. int n): float FindAvg (int x. int n); Getvalues should put values in both the xt1 array and at pu FindBig should return the largest integer in the first n elements of xt Findsml should return the smallest integer in the first n elements of x FindAvg should return the average of the first n elements of x t1 Thus, the main program should exactly something like the following #de fine CRTSECURENOWARNINGS #include // prototypes as listed above void main) - - - int at1oo], myBig, mysml, n; float myAvg: GetValues (a, &n); myBig-FindBig(a,n) mySml-Findsml (a,n); myAvg-FindAvg (a,n) printf ("The largest value is: sdIn" ,myBig) ; printf ("The smallest value is: tdn ,mySm1) printf ("The average value is: %,2f ".myAvg); A sample run is shown below (user input underlined). Note that user is prompte for value 1, 2, 3, as opposed to 0, 1, 2, Enter number of integer values: 5 Enter value 1: 20 Enter value 2: -15 Enter value 3: 90 Enter value 4 2 Enter value 5 30 The largest value is: 90 The smallest value is: -15 The average value is: 25.40

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!