#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main(void)
{
clrscr();
int nr,nc,i,j,s;
int mat1[10][10],mat2[10][10],mat3[10][10];
cout<<"Enter The Number Of Rows";
cin>>nr;
cout<<"Enter The Number Of Column";
cin>>nc;
for(i=0;i<nr;i++)
{
for(j=0;j<nc;j++)
{
cout<<"No. of rows"<<(i+1)<<"No. of column"<<(j+1)<<endl;
cin>>mat1[i][j];
}
}
cout<<"matrix 2";
for( i=0;i<nr;i++)
{
for( j=0;j<nc;j++)
{
cout<<"No. of rows"<<(i+1)<<"No. of column"<<(j+1)<<endl;
cin>>mat2[i][j];
}
}
for(i=0;i<nr;i++)
{
for(j=0;j<nc;j++)
{
for(s=0;s<nr;s++)
{
mat3[i][j]=mat1[i][j]+(mat2[i][s]*mat2[s][j]);
cout<<mat3[i][j];
cout<<"\t";
}
//cout<<mat3[i][j];
cout<<endl;
}
}
getch();
}
jnabeel
0
Newbie Poster
Recommended Answers
Jump to PostApart from using void main (this is wrong), what's your question?
All 3 Replies
Salem
5,138
Posting Sage
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
jnabeel
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.