IN JAVA
SUM ALL ELEMENTS BY ROW
Problem Description:
To read values of the number of rows and the number of columns for a two-dimensional (2D) array elements. Then, display the 2D array in a matrix form and sum all the elements by row in the 2D array.
Input:
2
3
6 8 3
184
Where:
- The first line represents the number of rows.
- The second line represents the number of columns.
- The third line contains array elements of the 1st row and so on.
Output:
683
184
17
13