Menu

Custom Search

C++ lab Program

#include
#include
#include
class matrix
{

int array[5][5];
int row, column;
public:
matrix(int x,int y)
{
row=x;
column=y;
}
friend istream &operator>>(istream &,matrix &);
friend ostream &operator<<(ostream &,matrix &); //matrix(matrix &x); void getdata(); matrix operator +(matrix m); matrix operator -(matrix m); matrix operator *(matrix m); void display(); }; /*matrix::matrix(matrix &x) { for(int i=0;i>(istream &in,matrix & m)
{
cout<<"Enter matrix elements:"<>m.array[i][j];
}
return in;
}
matrix matrix::operator +(matrix m)
{
matrix temp(row,column);
for(int i=0;i>m1;
matrix m2(2,2);
cin>>m2;
m3=m1+m2;
cout< m3=m1-m2;
cout< m3=m1*m2;
cout< getch();
}

No comments:

Post a Comment