#include <iostream>
usingnamespace std;
int main()
{
int numbers[6] = {1,4,3,7,6,5};
int compare = 0;
int largest = 0;
for (int i = 0; i < 6; i ++)
{
if (numbers[i] > compare)
{
compare = numbers[i];
largest = i+1; // because array index starts @ 0
}
}
cout << "The largest is : " << largest << " .";
return 0;
}
KooooOL!! THank you!!!!!
This is what I have so far. I have one more question. Shouldn't it return 0 because the number 300 is the highest and locating at element 0?