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 |
define a string class. overload the operator == to compare two strings
2 Answers Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,
what is the difference between containership and inheritence?
What is the difference between encapsulation and polymorphism?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What is function overloading and operator overloading?
You have one base class virtual function how will call that function from derived class?
Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?.
What are callback functions in c++
Why is oop useful?
what are the disadvantages of C++?
25 Answers ATS, Infosys, UNI, Wipro,
WHEN A COPY CONSTER IS CALL ?
Why do we use class in oops?