Answer to Question #180841 in C++ for Abhishek

Question #180841

Write a program to implement the following operations (the ones mentioned in comments) on Matrix. The main() function of the above program is as below:


1
Expert's answer
2021-04-13T02:00:03-0400
#include<iostream>
 #include<conio.h>
using namespace std;
class matrix{
 int rows;
 int cols;
 int mat[3][3];
 public:
 void getdata();
 void putdata();
 };
void matrix::getdata()
 {
 for(int i=1;i<=3;i++)
 {
 for(int j=1;j<=3;j++)
 {
  cout<<"A["<<i<<"]["<<j<<"] : ";
  cin>>mat[i][j];
 }
 }
 }
void matrix::putdata()
 {
 for(int i=1;i<=3;i++)
 {
 for(int j=1;j<=3;j++)
 {
  cout<<" "<<mat[i][j];
 }
 cout<<endl;
 }
 }
int main()
 {
 matrix m;
 m.getdata();
 m.putdata();
 
 return(0);
 }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS