Question: PQ 0 6 Write a function to return the index of the maximum value in an array. prototype: int findMaxArray ( int data [ ]

PQ06 Write a function to return the index of the maximum value in an array. prototype: int findMaxArray(int data[], int size); #define SIZE 12 int data[SIZE]={5,3,8,2,3,3,4,6,7,2,2,2}; declare variables in the function: int maxValue = data[0]; //assume the first array element is the largest. int maxIndex =0; //its index iterate through the array, if a value is greater than max, save it in max and save its index. return maxIndex; The max INDEX is 2. The max VALUE is 8. in c programming

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!