Page 132 - DCAP404 _Object Oriented Programming
P. 132
Unit 6: Constructors and Destructors
{ Notes
cout< <“\n”;
for(int j=0;j<d2;j++)
cout<<“\t”<<p[i] [j];
}
};
void matrix:: square(void)
{
cout < <“\n The Squared Matrix”;
for (int i = 0;i<d1 ;i++ )
{
cout<<“\n”;. for(intj=0;j<d2;j++)
cout<<“\t” <<p[i][j]*p[i] [j];
}
};
void matrix:: cube(void) {
cout < <“\nThe Cubed Matrix”;
for (int i = 0;i<d1;i++)
{
cout<<“\n”;
for(int j=0;j<d2;j++ )
cout<<“\t”<<p[i][j] * p[im] * p[i][j];
}
};
//Start Of Main Program
main()
{
intm,n;
elrser();
cout<<“Enter Size Of Matrix :- “;
cin> >rn>>n;
matrix mat(m,n);
mat.get_value();
mat.dis_value();
getch();
mat.square();
mat.cube();
LOVELY PROFESSIONAL UNIVERSITY 125