Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #define NR 10
  4.  
  5. int main()
  6. { int a[NR][NR],b[NR][NR],i,j,n;
  7. do
  8. {
  9. printf("introduceti numaru de elemente care le va avea matricea\n");
  10. scanf("%d",&n);
  11. } while(n>NR);
  12.  
  13.  
  14. printf("introduceti valorile matricei a");
  15.  
  16. for(i=0;i<n;i++)
  17. {for(j=0;j<n;j++)
  18. scanf("%d",&a[i][j]);
  19. }
  20.  
  21. printf("\n");
  22.  
  23.  
  24. printf("Introduceti valorile amtricei b");
  25.  
  26.  
  27. for(i=0;i<n;i++)
  28. { for (j=0;j<n;j++)
  29. scanf("%d",&a[i][j]);
  30. }
  31.  
  32. {
  33. int c[NR][NR];
  34. for (i=0;i<n;i++)
  35. {for (j=0;j<n;j++)
  36. c[i][j]=a[i][j]+b[i][j];
  37.  
  38. printf("%5d \n",c[i][j]);
  39. }
  40. }
  41. getch();
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement