Question: (Find the index of the largest element) Write a function that returns the index of the largest element in an array of numbers. If the
(Find the index of the largest element) Write a function that returns the index of the largest element in an array of numbers. If the largest element occurs more than once in the array, return the largest index. Using the following header: int indexOfLargestElement(double array[], int size) Write a test program that prompts the user to enter 10 numbers, invokes this function to return the index of the largest element, and displays that index. For example:
Enter a list of ten numbers:
4.5 6.7 8.92 -2.344 56.77 3.44 24.55 644.33 1.22 -9.8
The largest element has index: 7
Press any key to continue...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
