Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Nov 19, 2020
Embed
What would you like to do?
#include<iostream>
using namespace std;
int main(){
int n, m;
cin>>n>>m;
int arr[n][m];
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cin>>arr[i][j];
}
}
cout<<"Matrix : \n";
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cout<<arr[i][j]<<" ";
}
cout<<"\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment