(2704 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]

4 UpvotesUpvote |
4 DownvotesDownvote |

- Debug Javascript code in Android Mobile Browser [2698 Views]
- Mumbai University Computer Engineering Machine Learning (ML) Semester 8 Important Notes Download [4636 Views]
- Algorithm and Flowchart to Find transpose of a matrix [2028 Views]
- Write a C++ program to Make Simple Calculator in Console [1116 Views]
- Algorithm for Fibonacci series [4948 Views]

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