Skip to content

Instantly share code, notes, and snippets.

@whopiyush
Created December 4, 2018 08:19
Show Gist options
  • Select an option

  • Save whopiyush/cb6b42048daa37e77226ba871c921a9e to your computer and use it in GitHub Desktop.

Select an option

Save whopiyush/cb6b42048daa37e77226ba871c921a9e to your computer and use it in GitHub Desktop.
#include <conio.h>
#include <iostream>
using namespace std;
int main(){
int i,j,a[2][2],b[2][2],c[2][2];
cout << " Enter Matrix";
for(i=0 ; i < 2 ; i++){
for(j=0; j<2;j++) {
cin >> a[i][j];
}
for(j=0; j<2;j++) {
cin >> b[i][j];
}
for(j=0; j<2;j++) {
cin >> c[i][j];
}
}
cout << "Matrix: \n";
for(i=0;i<2;i++){
for(j=0;j<2;j++){
cout << a[i][j] + b[i][j] + c[i][j]<< "\t";
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment