Question: Write a program that takes as input an integer array. The input starts with an integer indicating the number of integers that follow and reads

Write a program that takes as input an integer array. The input starts with an integer indicating the number of integers that follow and
reads these values into an array. The program then swaps the maximum and minimum values in the array and prints out the new array.
You can safely assume that the number of integers in the array is always less than or equal to 10. You can also assume there are NO
repeated numbers in the array.
Ex: if the input is
5,2,3,1,8,6
then the program will output
2,3,8,1,6
You MUST define the following function to get the user input
void Getinput(int data[], int &nVals);
You MUST define the following function to swap the maximum and minimum values in the array and return the new array
void SwapMaxmin(int data[], int nVals);
 Write a program that takes as input an integer array. The

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!