Sum of rows and columns of a 2D array


Submit solution

Points: 10 (partial)
Time limit: 8.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C

Problem statement

Given a 2D Matrix, find the sum of rows and columns of the matrix. The size of the matrix(number of rows and columns of the matrix) should be obtained as input from the user. Display the sum of rows and columns of the matrix.

Sample Input

3

3

1 2 3 4 5 6 7 8 9

Sample Output

Sum of the 0 row is = 6

Sum of the 1 row is = 15

Sum of the 2 row is = 24

Sum of the 0 column is = 12

Sum of the 1 column is = 15

Sum of the 2 column is = 18


Comments

There are no comments at the moment.