#include<stdio.h>
int main()
{
int n, m, row, column, sum = 0;
printf("Enter Row and Column Number : ");
scanf("%d %d", &n, &m);
int anik[n][m];
printf("Enter Element For Matrix : \n");
for(row=0; row<n; row++)
{
for(column=0; column<m; column++)
{
scanf("%d", &anik[row][column]);
}
}
printf("\n");
for(column=0; column<m; column++)
{
for(row=0; row<n; row++)
{
sum = sum + anik[row][column];
}
printf("Column No. %d : ", column+1);
printf("%d\n", sum);
sum = 0;
}
return 0;
}
int main()
{
int n, m, row, column, sum = 0;
printf("Enter Row and Column Number : ");
scanf("%d %d", &n, &m);
int anik[n][m];
printf("Enter Element For Matrix : \n");
for(row=0; row<n; row++)
{
for(column=0; column<m; column++)
{
scanf("%d", &anik[row][column]);
}
}
printf("\n");
for(column=0; column<m; column++)
{
for(row=0; row<n; row++)
{
sum = sum + anik[row][column];
}
printf("Column No. %d : ", column+1);
printf("%d\n", sum);
sum = 0;
}
return 0;
}
Comments
Post a Comment