alaminrifat

Addition between three Matrix

Oct 14th, 2020 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int row,column;
  6.     int arr1[3][3],arr2[3][3],arr3[3][3];
  7.     cout<<"Enter matix 1 :: "<<endl;
  8.  
  9.         for(int i=0; i<3; i++){
  10.             for(int j=0; j<3; j++){
  11.                 cin>>arr1[i][j];
  12.             }
  13.         }
  14.  
  15.  
  16.             cout<<"Enter matix 2 :: "<<endl;
  17.             for(int i=0; i<3; i++){
  18.                 for(int j=0; j<3; j++){
  19.                 cin>>arr2[i][j];
  20.             }
  21.             }
  22.  
  23.  
  24.     cout<<"Enter matix 3 "" "<<endl;
  25.         for(int i=0; i<3; i++){
  26.             for(int j=0; j<3; j++)
  27.             {
  28.                 cin>>arr3[i][j];
  29.             }
  30.         }
  31.  
  32.     cout<<endl<<endl;
  33.     for(int i=0; i<3; i++)
  34.     {
  35.         for(int j=0; j<3; j++){
  36.             cout<<arr1[i][j]+arr2[i][j]+arr3[i][j]<<" ";
  37.         }
  38.         cout<<endl;
  39.     }
  40.     return 0;
  41. }
  42.  
  43.  
Advertisement
Add Comment
Please, Sign In to add comment