Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Addition of two matrix **Part 1
/* **samuel ugochukwu nwutobo **19 jun 2017 **Addition of two matrix **Part 1 */ #include <iostream> using namespace std; int main() { cout<<"MATRIX 1"<<endl; int x[3][3] { {1,1,1}, {2,2,2}, {3,3,3}}; int y[3][3] { {4,4,4}, {5,5,5}, {6,6,6}}; for(int i =0;i < 3;i++) { for(int j=0;j <3;j++) cout<<x[i][j]<<" "; cout<<endl; } cout<<endl; cout<<"MATRIX 2"<<endl; for(int i =0;i < 3;i++) { for(int j=0;j <3;j++) cout<<y[i][j]<<" "; cout<<endl; } cout<<endl; cout<<"___________________________\n"; cout<<"MATRIX 1 PLUS MATRIX 2"; cout<<"\n___________________________"; cout<<endl; cout<<endl; cout<<"EQUALS"<<endl; cout<<endl; int z[3][3]; for(int i =0;i < 3;i++) { for(int j=0;j <3;j++) z[i][j]=x[i][j]+y[i][j]; } for(int i =0;i < 3;i++) { for(int j=0;j <3;j++) cout<<z[i][j]<<" "; cout<<endl; } }
run
|
edit
|
history
|
help
0
VecHotel3
palindrome
Riemann's prime number formula
project
PhB
so
多态
LRU cache
Stream8
perfect square