Write a function find_min that takes a double pointer indicating the start of an array, and an int indicating the length of the array. It should return a pointer to the minimum number in the array.
#include <iostream>
usingnamespace std;
double* find_min(double* a, int n)
{
/*not sure what goes in here. this is what I have so far:
double *min= a;
for (int i=0; i<n; i++) {...
*/
}
int main() {
int n;
cin >> n;
double arr[100];
for (int i=0; i<n; i++) cin >> arr[i];
// call your function and save result
double* min_loc = find_min(arr, n);
cout << ...; // there is some hidden testing code here
cout << "Pointed-to value is " << *min_loc << endl;
// change that variable to 1000
*min_loc = 1000;
// run your code again
min_loc = find_min(arr, n);
cout << ...; // there is some hidden testing code here
cout << "Pointed-to value is " << *min_loc << endl;
}