#include <iostream>
usingnamespace std;
void minmax(double *numbers, int npts, double *min_ptr, double *max_ptr);
int main()
{
int i, npts;
double min, max;
double arr[100];
cout << "How many numbers would you like to enter?" << endl;
cin >> npts;
cout << "Enter the " << npts << " numbers separated by whitespace." << endl;
for (i=0; i<npts; i++)
cin >> arr[i];
minmax(arr, npts, &min, &max);
cout << "The min is " << min << " and the max is " << max << endl;
return 0;
}
void minmax(double *numbers, int npts, double *min_ptr, double *max_ptr)
{
int i; //for loop index
min_ptr = numbers;
for (i=1; i<npts; i++)
{
if (*numbers + i < *min_ptr);
{
cout << *(numbers + i) << endl;
min_ptr = (numbers + i);
}
}
return;
}