Question: Write a program in C++ that asks the user to enter an array of size N and find index of the largest value in that

Write a program in C++ that asks the user to enter an array of size N and find index of the largest value in that array using a function named largest_location that takes an array of integer values and an integer that tells how many integer values are in the array as arguments. The function should return as its value the index of the cell containing the largest of the values in the array. Do not forget to write the main function as well. Your main function should get the array from the user and pass it to the function largest_location. Print the index of the largest location in the main function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!