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
What is difference between multiple inheritance and multilevel inheritance?
What is the purpose of enum?
What is difference between inheritance and polymorphism?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What are functions in oop?
What is solid in oops?
What is object and class in oops?
Can we override main method?
hi all..i want to know oops concepts clearly can any1 explain??
What polymorphism means?
• What are the desirable attributes for memory managment?
Can destructor be overloaded?
State what is encapsulation and friend function?
What is inheritance in simple words?