title: C++ Print Row Number along with Maximum Sum of Rows 2D Arrays
body: <p>I am trying to calculate the sum of rows in 2d array and compare the maximum sum of row with other rows. I successfully calculated the sum of each row and also compared the row's maximum with other rows but problem I am currently facing is I don't know how to print the row number that has maximum sum. Here is a piece of code that I am working on:</p>
  
  <pre><code>void calculateMaxRowSum(int array[10][10])
  {
       int maxsum = 0;
       for(int i=0;i&lt;10;i++) 
       {  
            int sum = 0;  
            for(int j=0;j&lt;10;j++)
            {
                 sum = sum + array[i][j];
            }
                 if(sum &gt; maxsum)
                      maxsum = sum;
       }
       cout&lt;&lt;"Row No. "&lt;&lt;(Problem is here)&lt;&lt;" has maximum sum: "&lt;&lt;maxsum&lt;&lt;endl;
  }
  </code></pre>
  
  <p>Please help me out.
  Thanks!!!</p>