Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int row, column, i, j;
- int A[10][10], B[10][10], res[10][10];
- printf("Enter the element of first matrix\n");
- for (i = 0; i < 4; i++)
- {
- for (j = 0; j < 4; j++)
- {
- scanf("%d", &A[i][j]);
- }
- }
- printf("Enter the element of the second matrix\n");
- for (i = 0; i < 4; i++)
- for (j = 0; j < 4; j++)
- scanf("%d", &B[i][j]);
- printf("The difference between the matrix A-B\n");
- for (i = 0; i < 4; i++)
- {
- for (j = 0; j < 4; j++)
- {
- res[i][j] =A[i][j] -B[i][j];
- printf("Therefore the resultant matrix after the subtraction of the 4x4 matrix is %d\t",res[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
- //Happy Coding
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement