forked from kushalsingh-00/C-Programs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
arr7.c
42 lines (37 loc) · 787 Bytes
/
arr7.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
-------------------------------------------------------
Name : Sum
Author : Kushal Singh Rathore
Discription : Sum Of Row And Column
-------------------------------------------------------
*/
#include<stdio.h>
int main()
{
int sum=0;
int a[5][5]={{8,3,9,0,10},
{3,5,17,1,1},
{2,8,6,23,1},
{15,7,3,2,9},
{6,14,2,6,0}};
printf("Row Total\n");
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
sum+=a[i][j];
}
printf("%d ",sum);
sum=0;
}
printf("\nColumn Sum\n");
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
sum+=a[j][i];
}
printf("%d ",sum);
sum=0;
}
}