Hello my name is Leonard E. Norwood Jr.
I haven't been back much but I'm still studying and practicing C++
I'm still doing arrays starting from beginning to better get used it it.
Anyway, it's a simple program of finding the largest number of the 10 numbers. I know my math well, but something is under my nose to fix this problem. First of all, I sometimes get the max number correctly out of different kinds of numbers, at times it doesn't unless I fix it up a little. Second, trying to find the element where the highest number in the list is located. Also, the array name is wrong as it is called grade, but supposed to be fmax, standing for find max, I can fix that easily. I'm just getting stomped on mostly number 2 problem, finding the element of the value of the highest number and display it. Does anybody understand what I'm saying.
I haven't done much big problems lately since I'm still practicing and working out the errors until I'm confident enough. Anyway...that's all.
#include <iostream>
using namespace std;
int main()
{
const int NUMES = 10;
int i, max, grade[NUMES];
cout << "In this program, you will enter ten integer numbers and this program"
"will find the maximum value of these ten numbers. " << endl;
max = grade[0];
for(i = 0; i < NUMES; i++)
{
cout << "Enter a grade: ";
cin >> grade[i];
if (grade[i] > max)
max = grade[i];
}
cout << "The maximum value of the numbers is: " << max << endl;
cout << "The element number is " << i << " in the list of numbers. " << endl;
system("pause");
return 0;
}