SabirSazzad

Martix Sum

Feb 20th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int i,j;
  5.     int A[3][3] = {3,11,9,4,2,5,7,0,1};
  6.     int B[3][3] = {1,9,3,5,6,2,15,10,5};
  7.     int Sum[3][3];
  8.     for(i=0;i<3;i++)
  9.     {
  10.         for(j=0;j<3;j++)
  11.         {
  12.             Sum[i][j] = A[i][j] + B[i][j];
  13.         }
  14.     }
  15.     printf("The Addition of two Matrix is:\n");
  16.     for(i=0;i<3;i++)
  17.     {
  18.         for(j=0;j<3;j++)
  19.         {
  20.             printf("%d\t",Sum[i][j]);
  21.         }
  22.         printf("\n");
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment