Write a program to multiply 3x3 matrics

Answer Posted / sandip khairnar

#include<conio.h>
void main()
{
int i,j,k,sum,a[3][3],b[3][3],c[3][3];
clrscr();
cout<<"enter matrix1";
for(i=0;i<3;i++)
for(j=0;j<3;j++)
cin>>a[i][j];
cout<<"enter matrix2";
for(i=0;i<3;i++)
for(j=0;j<3;j++)
cin>>b[i][j];
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
sum=0;
for(k=0;k<3;k++)
sum=sum+(a[i][k]*b[k][j]);
c[i][j]=sum;
}
}
cout<<"output:"<<endl;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
cout<<c[i][j]<<" ";
cout<<endl;
}
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a programe to calculate the simple intrest and compund intrest using by function overlading

1678


what is the drawback of classical methods in oops?

2926


What is inheritance and how many types of inheritance?

634


What is difference between pop and oop?

615


What do you mean by variable?

583






What is multilevel inheritance?

734


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

1636


to find out the minimum of two integer number of two different classes using friend function

1645


what type of questions

1701


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

3859


What is the important feature of inheritance?

641


What does enum stand for?

622


What is this pointer in oop?

565


What is encapsulation example?

559


What is a class in oop?

614