
Computer Software and Programming I-83
34. Draw a flowchart to add two matrices.
Ans: The flowchart to add two matrices is shown here.
Start
Read row1, col1,
row2, col2
Print “Addition
not possible”
Is
(row1 = row2) and
(col1 = col2)?
No
Yes
Yes
Yes
No
No
i = 1
Is
i < = row1?
i = i + 1
j = 1
Is
j < = col1?
Read A [ i ] [ j ]
and B [ i ] [ j ]
C [ i ] [ j ] =
A [ i ] [ j ] + B [ i ] [ j ]
Print C [ i ] [ j ]
j = j + 1
Stop
M04_ITL-ESL4791_01_SE_C04.indd 83 12/22/2012 4:53:52 PM