Issues

. For a given array, find the maximum value and the position of this maximum value in the
array
a. Create a function to find the position of the max value in an array.
b. In your main function, create and initialize an array, then call this findMax
function to display the position of the maximum value in the array and display this
value based on the position information.

So far I have something like this

#include <iostream>

using namespace std;

void find_max(int[], int, int &, int &);

int main()
{
int array[8] = { 7, -15, 239, -17, -22, 345, 0, 11 };

int index_value;
int max_value;

find_max(array, 8, max_value, index_value);

// main() prints the values evaluated by find_max() function.
cout << "\n Max Value: " << max_value <<endl;
cout << "Index: " << index_value <<endl;

return 0;
}

I am not sure where to go from here
Topic archived. No new replies allowed.