#include<stdio.h>
#include<conio.h>
main( )
{
int a[20][20],sum;
int i, j, m, n;
clrscr();
printf ("Enter the order m x n of the matrix\n");
scanf ("%d%d", &m, &n);
printf ("enter the elements of the matrix\n");
for (i = 1; i<=m; ++i)
{
for (j = 1; j<=n; ++j)
scanf ("%d", &a[i] [j]);
}
sum = 0;
for (i=1; i<=m; ++i)
{
for (j=1; j<=n; ++j)
sum+=a[i][j];
}
printf ("sum of all element is %d", sum);
getch();
}