Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void multiply (){
- int a[3][2]= {{1,1},{2,2},{3,3}};
- int b[2][3]= {{2,2,2},{2,2,2}};
- int c[3][3]= {{1,1,1},{1,1,1},{1,1,1}};
- int product[3][3]= {{0,0,0},{0,0,0},{0,0,0}};
- for(int row = 0; row <3; row++){
- for(int col =0; col <3; col++){
- for(int inner=0;inner<2;inner++){
- product[row][col] += a[row][inner]* b[inner][col];
- }
- cout<< product[row][col]<<" \t";
- }
- cout<<endl;
- }
- }
- int main(){
- multiply();
- getchar ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement