This C program adds two matrices entered by the user. To add matrices, the dimensions of the matrices must be same.
To add two matrices, we add the corresponding elements of the matrices.
Program: Add 2-D arrays in C
Output: Print sum of matrices in C
Enter the number of rows and columns of matrix: 2 2
Enter the elements of first matrix: 4 7 6 9
Enter the elements of second matrix: 11 5 3 7
Sum of entered matrices:
15 12
9 16
Share your code and queries in the comments.
Share this code with your programmer friends.
Follow us on twitter.