Write a program to multiply 3x3 matrics
Answer / 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 |
Is data hiding and abstraction same?
Is abstract thinking intelligence?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
Is this job good for future? can do this job post grduate student?
What is function overloading?,describe it with the example.
What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Compiler error: Lvalue required
why c++ is called OOPS? waht is inherutance? what is compiler?
what is a binary overloading
What are different oops concepts?
What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 2) 17 3) 16.5
Write a program to demonstrate the use of 'Composition' in C++
What is a friend function & its advantage?