#include<stdio.h>
#include<conio.h>
main()
{
int i,j,a[10][10],sum,m,n;
printf("\nEnter the number of Rows : ");
scanf ("%d",&m);
printf("\nEnter the number of Columns : ");
scanf ("%d",&n);
for(i=0;i<m;i++)
for(j=0;j<n;j++ )
{
printf("\nEnter the Element a[%d][%d] : ", i , j);
scanf("%d",&a[i][j]);
}
sum = 0;
for(i=0;i<m;i++ )
for(j=0;j<n;j++ )
{
sum = sum + a[i][j];
}
printf("\nThe Addition of All Elements in the Matrix : %d\n",sum);
}
#include<conio.h>
main()
{
int i,j,a[10][10],sum,m,n;
printf("\nEnter the number of Rows : ");
scanf ("%d",&m);
printf("\nEnter the number of Columns : ");
scanf ("%d",&n);
for(i=0;i<m;i++)
for(j=0;j<n;j++ )
{
printf("\nEnter the Element a[%d][%d] : ", i , j);
scanf("%d",&a[i][j]);
}
sum = 0;
for(i=0;i<m;i++ )
for(j=0;j<n;j++ )
{
sum = sum + a[i][j];
}
printf("\nThe Addition of All Elements in the Matrix : %d\n",sum);
}
No comments:
Post a Comment