Showing posts with label To Print Addition Of Matrix. Show all posts
Showing posts with label To Print Addition Of Matrix. Show all posts

Tuesday, 31 January 2012

Program To Print Addition Of Matrix In C++


#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
cout<<"\n Enter Rows=";
cin>>m;
cout<<"Enter COlumns=";
cin>>n;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
cout<<"ENter Number=";
}
}
cout<<"\n ===============First Matrix IS==========================\n";
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
}
cout<<"\n";
}

for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
cout<<"ENter Number=";
}
}
cout<<"\n ===============Second Matrix IS==========================\n";
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
}
cout<<"\n";
}

cout<<"\n ==============Addition of Matrix IS==========================\n";
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
c[i][j]=a[i][j] + b[i][j];
cout<<"\t"<<c[i][j];
}
cout<<"\n";
}
getch();
}