Twitter Feed Facebook Google Plus Youtube

Adsense responsive

Recent Post below header

Friday, 21 June 2013

C PROGRAM: TO FIND SUM OF ELEMENTS OF MATRIX

CODING:
#include<conio.h>
#include<stdio.h>
void main()
{
    int a[10][10],i,j,m,n,sum=0;
    clrscr();
    printf("Enter order of matrix: ");
    scanf("%d%d",&m,&n);
    printf("\n\n");
    for(i=1;i<=m;i++)
       for(j=1;j<=n;j++)
       {
          printf("Enter value of a[%d][%d]: ",i,j);
          scanf("%d",&a[i][j]);
          sum+=a[i][j];
       }
    printf("\n\nSum of elements of matrix is %d",sum);
    getch();
}



C PROGRAM CODING
CODING
Click on images to view them correctly.

C PROGRAM OUTPUT
OUTPUT

For any query or suggestion please comment below...

No comments:

Post a comment