Algorithm and flowchart of matrix addition
Answers
Flowchart for Matrix addition:
•Step 1: Start
•Step 2: Declare matrix A[r][c]
and matrix B[r][c]
and matrix C[r](c)
rows= r columns= c
•Step 3: Read r, c, p, A and B
•Step 4: Declare variable i=0, j=0
•Step 5: Repeat until i < r
5.1: Repeat until j < c
C[i][j]=A[i][j] + B[i][j]
Set j=j+1
5.2: Set i=i+1
•Step 6: C is the required matrix
•Step 7: Stop
Algorithm of matrix addition :
1) We first define three matrices A,B,
C and read their respective row
and column numbers in variable r
and c .
2) 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].