#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[3][3], b[3][3], c[3][3], i, j;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"\nEnter the value of a["<<i+1<<"]["<<j+1<<"]...";
cin>>a[i][j];
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"\nEnter the value of b["<<i+1<<"]["<<j+1<<"]...";
cin>>b[i][j];
}
}
cout<<"\n";
cout<<"Resultant Matrix\n\n";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
cout<<c[i][j]<<"\t";
}
cout<<"\n";
}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a[3][3], b[3][3], c[3][3], i, j;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"\nEnter the value of a["<<i+1<<"]["<<j+1<<"]...";
cin>>a[i][j];
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"\nEnter the value of b["<<i+1<<"]["<<j+1<<"]...";
cin>>b[i][j];
}
}
cout<<"\n";
cout<<"Resultant Matrix\n\n";
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
cout<<c[i][j]<<"\t";
}
cout<<"\n";
}
getch();
}
No comments:
Post a Comment