0

How am I suppose to use 2d matrix

c++

11/4/2016 4:06:18 PM

CAPT. Andy

1 Answer

New Answer

+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.