SHARE
TWEET

subtraction between the two matrix

a guest Dec 8th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int row, column, i, j;
  6.     int A[10][10], B[10][10], res[10][10];
  7.  
  8.  
  9.     printf("Enter the element of first matrix\n");
  10.  
  11.     for (i = 0; i < 4; i++)
  12.     {
  13.          for (j = 0; j < 4; j++)
  14.          {
  15.               scanf("%d", &A[i][j]);
  16.          }
  17.     }
  18.  
  19.     printf("Enter the element of the second matrix\n");
  20.  
  21.     for (i = 0; i < 4; i++)
  22.         for (j = 0; j < 4; j++)
  23.             scanf("%d", &B[i][j]);
  24.  
  25.     printf("The difference between the matrix A-B\n");
  26.  
  27.     for (i = 0; i < 4; i++)
  28.     {
  29.         for (j = 0; j < 4; j++)
  30.         {
  31.             res[i][j] =A[i][j] -B[i][j];
  32.  
  33.             printf("Therefore the resultant matrix after the subtraction of the 4x4 matrix is %d\t",res[i][j]);
  34.         }
  35.         printf("\n");
  36.     }
  37.  
  38.     return 0;
  39. }
  40.  
  41. //Happy Coding
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top