//Write a function: int max(int list[], int n) that recursively finds the largest integer between list[0] and list[n]. Assume at least one element in the list. Test it with a main program that takes as input an integer count followed by that many values. Output the original values followed by the maximum. Do not use a loop in max(). Output the value in the main program, not in the funcion.
//Sample input:
//5 50 30 90 20 80
//Sample output:
//Original list: 50 30 90 20 80
//Largest value: 90
# include <iostream>
using namespace std;
int max(int list[], int n)
int main ()
{
int list[30]
cout << "please type in numbers: ";
cin.getline (list, 30, '\n');
cout << "original list: " << list [] << endl;
cout << "largest value: " << n << endl;
system ("pause");
return 0;
}
int max(int list[], int n)
{
//am not sure what to do next. I get the concept that i have to keep minmizing it, bit i so not know how to do that. please help!