(6200 Views)

We can add, subtract, multiply and divide 2 matrices of multi-dimensions. For that, we take input from the user the number of rows, columns, first matrix elements and second matrix elements. Then we perform multiplication on the matrices entered by the user and store it in some other matrix.

In matrix addition, one row element of first matrix is individually added to corresponding column elements.

In the above algorithm,

- We first define three matrices A, B, C and read their respective row and column numbers in variable r and c
- Read matrices A and B.
- First, start a loop for getting row elements of A and B

Secondly, inside it again start a loop for column of A and B - Then, we store their corresponding addition by C[i][j]=A[i][j] + B[i][j] into C[i][j]

12 UpvotesUpvote |
11 DownvotesDownvote |

- Top Project Management Platforms Every Business Team should Know - Slack, Zoho, Teamwork Projects [1894 Views]
- Setting Up Unity for Installing Application on Android Device [4532 Views]
- Write a C++ program to Make Simple Calculator in Console [1372 Views]
- Pseudocode and Algorithm to find Largest of 2 numbers [2080 Views]
- Create a Custom Marker in Artoolkit [5598 Views]

- How To Win Ludo King Game Every Time [31962 Views]
- Algorithm to find whether number is Armstrong Number or Not [30440 Views]
- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [24942 Views]
- Jio Phone hang on LOGO problem Solution - Hard Reset Jio Phone [21832 Views]
- FlowChart and Algorithm to find Whether a Number is Even or Odd [16278 Views]