Reference no: EM132210463
Question :
Write a program that will prompt the user for the number of elements in a data set of integers.
You will then allocate a 1d array of that size and fill this array from the keyboard (test with small data sets and use redirected input).
After the array, has been filled from the keyboard you will find the min and max of that data set and output them to the screen.
Before you exit the program, free the memory up. You are guaranteed that the size of the data set will be positive and greater than 3.
Write a function that has parameters of the array and the number of elements in the array.
This function should return the minimum value within the array. A sample of the function call would look like: minval = min(arr, size);
Write a function that has parameters of the array and the number of elements in the array. This function should return the maximum value within the array.
A sample of the function call would look like: maxval = max(arr, size); A typical run of your program may look like this.
My input is In red. Enter the number of elements in your data set: 10 30 40 25 16 20 -6 14 99 4321 876 The Minis 6 The Max is 4321