Displaying Source Code(s)
|
|
Program for addition of two 3*3 matrices
--------------------------------------------------------------------------------
:#include<stdio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],i,j;
printf("enter the elements of 1st 3*3 matrix");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",a[i][j]);
}
}
printf("enter the elements of 1st 3*3 matrix");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",b[i][j]);
}
}
printf("the sum matrix is");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf("%d",c[i][j]);
}
}
}
--------------------------------------------------------------------------------
|
|
|