#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <string>
usingnamespace std;
int main()
{
int fmax[10] = {0};
int counter;
int max = 0;
for (counter = 0; counter < 9; counter++)
{
cout << "\nEnter a number: ";
cin >> fmax[counter];
if (fmax[counter] > max)
{
max = fmax[counter];
}
}
cout << "The maximum value is: " << max << endl;
cout << "This is element number " << fmax[counter] << " in the list of numbers" << endl;
return 0;
}
You're not storing that information anywhere. On line 27, you need to store the value of the index. Then, on line 37, you can output the value of the index.