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

49 UpvotesUpvote |
24 DownvotesDownvote |

- How to compile and install OpenCV in Eclipse [900 Views]
- Flowchart and Algorithm for Tower of Hanoi [2115 Views]
- Anagram Detection Problem for a string in Python [211 Views]
- Quick Sort Algorithm and Flowchart with implementation in Java [432 Views]
- Mumbai University Computer Engineering Machine Learning (ML) Semester 8 Important Notes Download [2830 Views]

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