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 |
why destructor is not over loaded?
4. What do you mean by a prototype? Define analysis prototype
Why is polymorphism used?
Write a program to multiply 3x3 matrics
What are functions in oop?
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 is encapsulation and abstraction? How are they implemented in C++?
0 Answers Agilent, ZS Associates,
What is methods in oop?
What do you mean by Encapsulation?
1. Define a class.
what is difference between objects and function
What are virtual classes?