Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int i, j, k, n, m, r, c;
- cout<<"Enter the dimension of the matrices\n";
- cout<<"Number of rows : ";
- cin>>r;
- cout<<"Number of columns : ";
- cin>>c;
- int A[r][c], B[r][c], C[r][c];
- cout<<"Enter the elements of A matrice :\n";
- for(i = 0; i < r; i++)
- for(j = 0; j < c; j++)
- cin>>A[i][j];
- cout<<"Enter the elements of B matrice :\n";
- for(i = 0; i < r; i++)
- for(j = 0; j < c; j++)
- cin>>B[i][j];
- cout<<"Enter the elements of C matrice :\n";
- for(i = 0; i < r; i++)
- for(j = 0; j < c; j++)
- cin>>C[i][j];
- cout<<"A+B+C : \n";
- for(i = 0; i < r; i++)
- {
- for(j = 0; j < c; j++)
- cout<<A[i][j]+B[i][j]+C[i][j]<<" ";
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement