// Find the minimum and maximum values in an array. // Michael Rothstein // 2/12/14 #include const int NMAX =100; using std::cin; using std::cout; using std::endl; void minmax(const int a[],int n,int &min,int &max); int main(){ int data[NMAX]; cout << "How many items are there? "; int n; cin >> n; cout << "Please enter the numbers, one by one.\n"; for(int i=0;i> data[i]; } int min,max; minmax(data,n,min,max); cout << "The smallest number is " << min << " and the largest is " << max << endl; } void minmax(const int a[],int n, int&min, int&max){ min = max = a[0]; for(int i=1;i