//Write a program to print addition and average of all elements from each column of a matrix of size //4X4. Accept matrix elements from user.
#include <stdio.h>
void main ()
{
int array[10][10];
int i, j, m, n, sum = 0;
clrscr();
printf("Enter the order of the matrix\n");
scanf("%d %d", &m, &n);
printf("Enter the co-efficients of the matrix\n");
for (i = 0; i < m; ++i)
{
for (j = 0; j < n; ++j)
{
scanf("%d", &array[i][j]);
}
}
sum = 0;
for (j = 0; j < n; ++j)
{
for (i = 0; i < m; ++i)
{
sum = sum + array[i][j];
}
printf("Sum of the %d column is = %d\n", j+1, sum);
sum=0;
}
}