#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],i,j;
clrscr();
printf("Enter the elements into first matrix \n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&a[i][j]);
printf("\nEnter the elements into second matrix\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&b[i][j]);
for(i=0;i<3;i++)
for(j=0;j<3;j++)
c[i][j]=a[i][j]+b[i][j];
for(i=0;i<3;i++)
{
printf("\t\t");
for(j=0;j<3;j++)
printf("%d\t",c[i][j]);
printf("\n\a");
}
getch();
}
This blog will cover all important aspects of 'C' 'C++', 'Data Structures in C' and other Technical stuffs. In this blog you will find good C Interview Questions Answers. I will be posting both multiple choice and subjective type C interview questions and answers. Tutorials will be posted from time to time that will focus on problem solving.
Saturday, April 14, 2012
C Program to calculate and display sum of two matrix
Labels:
c,
c language,
programming,
simple c programs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment