New course! Every coder should learn Generative AI!
Try a free lesson+ 1
#include <iostream>
using namespace std;
int main() {
int a[3][3];
// these loops are to take input
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cin>>a[i][j];
}
}
// similarly loop for outputting matrix
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout<<a[i][j];
}
cout<<endl;
}
return 0;
}
// you can also perform some basic operations like finding sum and product of matrix. Try it in playground.