Given a two dimensional array of integers A write a method
     Given a two dimensional array of integers A[] [], write a method that returns the row whose summation of  elements is the largest.  e.g. Given array 1, 2, 0, 10 2, 0, 4, 4  0, 2, 5, 11  The sum of each row is as follows; 13 for row 0, 10 for row 1, 18 for row 2. Therefore, the returned row will be 0, 2, 5, 11![Given a two dimensional array of integers A[] [], write a method that returns the row whose summation of elements is the largest. e.g. Given array 1, 2, 0, 10   Given a two dimensional array of integers A[] [], write a method that returns the row whose summation of elements is the largest. e.g. Given array 1, 2, 0, 10](/WebImages/3/given-a-two-dimensional-array-of-integers-a-write-a-method-973838-1761499936-0.webp) 
  
  Solution
int largerrow(int A [3][4])
{
int i,j;
int sum[3]={0,0,0},k=0;
for (i=0;i <=2;i++){
for (j=0;j<=3;j++){
sum[k]= A [i][j]+sum[k];
}
k++;
}
if (sum [0]>sum [1])
{
if(sum [0]>sum [2])
return A [0][4];
else
return A [2][4];
}
else if (sum [1]>sum [2])
return A[1][4];
else
return A [2][4];
}
![Given a two dimensional array of integers A[] [], write a method that returns the row whose summation of elements is the largest. e.g. Given array 1, 2, 0, 10   Given a two dimensional array of integers A[] [], write a method that returns the row whose summation of elements is the largest. e.g. Given array 1, 2, 0, 10](/WebImages/3/given-a-two-dimensional-array-of-integers-a-write-a-method-973838-1761499936-0.webp)
