Reference no: EM132196144
Write a C program with the following functions:
minMax, a void function with 4 args:
a pointer to an unsigned in main (I'll call it pMin)
a pointer to another unsigned in main (I'll call it pMax)
an array of doubles that minMax won't change
the # of elements in the array
minMax may assume without checking that the array has at least one element.
minMax may assume without checking that all values in the array are different.
minMax may not assume that the unsigneds that the first two args point to havesensible values on entry.
minMax's job is to set pMin's unsigned to the index of the smallest element in thearray, and to set pMax's unsigned to the index of the largest element in the array.
main: create an array of doubles with some values, and a couple of unsignedvariables.
call minMax to get the indices of the minimum and maximum elements.
Finally, output the indices and the values of the elements with explanatory text.
For example if your array held {3.3, 2.2. 1.1, 5.5, 4.4}, then your output might look
like a[2] = 1.1, a[3] = 5.5