# 3. Implement a function called findLargestIndex which returns the index of the rowwith the largest sum.ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24{2, 4, 5, 1, 3, 4}, // sum = 19{1, 0, 9, 0, 1, 0}}; // sum = 11If the findLargestIndex function was called using this array, it would return 0, asit is returning the index of the row, not the sum.Note that the number of columns is required when passing a 2d array to a function.Assume that 2D arrays passed to this function will have 6 columns.Title line: int findLargestIndex(int array[][6], int rows, int columns);

Question
195 views

3. Implement a function called findLargestIndex which returns the index of the row
with the largest sum.
ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24
{2, 4, 5, 1, 3, 4}, // sum = 19
{1, 0, 9, 0, 1, 0}}; // sum = 11
If the findLargestIndex function was called using this array, it would return 0, as
it is returning the index of the row, not the sum.
Note that the number of columns is required when passing a 2d array to a function.
Assume that 2D arrays passed to this function will have 6 columns.
Title line: int findLargestIndex(int array[][6], int rows, int columns);

check_circle

Step 1

The function called findLargestIndex is used to find the index of a row whose all element sums are largest in an array.

Declare a 2-dimensional array with 3 rows and 6 columns.

Assign the value to the array.

Call the function to find the row index.

The function findLargestIndex called with three-parameter. One is array, second ...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in