Here is the question: write a complete function definition for a function named findLargest that accepts as array of int as a parameter and accepts the array size as another parameter. The function should use a return statement to return the largest value in the array.
here is my rough code:
int findLargest()
{
int size;
cout << "Enter size of array" << endl;
cin >> size;
int i;
int numArray [size];
{
for (i = 1; i < size; index++);
{
cout << "Enter " << i << "number" << endl;
cin >> numArray [i];
}
}
int findLargest = numArray[1]
int t;
for (t = 2; t < 2 size ; index++);
{
if numArray[t] < findLargest
{
findLargest = numArray[t];
}
}
cout << "Your highest number is " << findLargest;
}
if anyone could help with the correct solution that would be great.