Answer:
Following is the program in c++ language
#include <iostream> // header file
using namespace std; // namespace
int maxSum(int ar[][10],int r) // function definition of maxsum
{
int s=0; // varaible declaration
for(int k=0;k<r;k++)// iterating the loop
{
int maximum=ar[k][0]; //finding the maximum value
for(int k2=0;k2<10;k2++)// iterating the loop
{
if(maximum<ar[k][k2]) // check the condition
{
maximum=ar[k][k2]; // storing the value in the maximum variable
}
}
s=s+maximum;//adding maximum value to the sum
}
return s; // return the sum
}
int main() // main function
{
int ar[][10]={{5,2,8,-8,9,9,8,-5,-1,-5},{4,1,8,0,10,7,6,1,8,-5}}; // initilaized array
cout<<"sum of maximum value:";
int t=maxSum(ar,2); // function calling
cout<<t; // display the maximum value
}
Output:
sum of maximum value:19
Explanation:
Following are the description of Program