Advertisement
parallelogram

Untitled

Nov 24th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int a[100][100],b[100][100],c[100][100],i,j,n;
  7.  
  8.     scanf("%d",&n);
  9.  
  10.     for (i=0;i<n;i++)
  11.     {
  12.         for(j=0;j<n;j++)
  13.         {
  14.             scanf("%d",&a[i][j]);
  15.         }
  16.     }
  17.  
  18.     printf("--------------------\n");
  19.  
  20.     for (i=0;i<n;i++)
  21.     {
  22.         for(j=0;j<n;j++)
  23.         {
  24.             scanf("%d",&b[i][j]);
  25.         }
  26.     }
  27.  
  28.      printf("--------------------");
  29.  
  30.  
  31.      for (i=0;i<n;i++)
  32.     {
  33.         for(j=0;j<n;j++)
  34.         {
  35.             c[i][j]=a[i][j]+b[i][j];
  36.         }
  37.     }
  38.  
  39. for (i=0;i<n;i++)
  40.     {
  41.         for(j=0;j<n;j++)
  42.         {
  43.             printf("%d ",&c[i][j]);
  44.         }
  45.  
  46.         printf("\n");
  47.     }
  48.  
  49.  
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement