×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Dec 13, 2020 5:12 PM
Views: 4613
Tags: twodimarray
  1.            int rows = a.length;
  2.         int cols = a[0].length;
  3.         int sumRow = 0;
  4.  
  5.  
  6.         for(int i = 0; i < rows; i++){
  7.             sumRow = 0;
  8.             for(int j = 0; j < cols; j++){
  9.                 sumRow = sumRow + a[i][j];
  10.             }
  11.             System.out.println("Sum of " + (i+1) +" row: " + sumRow);
  12.