answersLogoWhite

0

Identification division.

Program-id.

Environment division.

Data division.

Working-storage section.

01 array.

02 x occurs 4 times.

03 y occurs 4 times.

04 a pic 9(2).

04 b pic 9(2).

04 c pic 9(3).

77 m pic 9.

77 n pic 9.

77 i pic 9.

77 j pic 9.

77 e pic 9.

77 p pic zz9.

Procedure division.

Main-para.

Display " enter the order of the matrices ".

Accept m.

Accept n.

Compute e = m * n.

Move 2 to lin.

Move 3 to col.

Display " enter " e " numbers for first matrix ".

Perform x-para varying i from 1 by 1 until i > m

after j from 1 by 1 until j > n.

Display " enter " e " numbers for second matrix ".

Perform y-para varying i from 1 by 1 until i > m

after j from 1 by 1 until j > n.

Perform c-para varying i from 1 by 1 until i > m

after j from 1 by 1 until j > n.

Display ( 1 , 1 ) erase.

Display " the sum of the two matrices is ".

Perform d-para varying i from 1 by 1 until i > m

after j from 1 by 1 until j > n.

Stop run.

X-para.

Accept a( i , j ).

Y-para.

Accept b( i , j ).

C-para.

Compute c( i , j ) = a( i , j ) + b( i , j ).

D-para.

Move c( i , j ) to p.

Display ( lin , col ) p.

Compute col = col + 3.

If ( j = n )

compute lin = lin + 1

move 3 to col.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Is there any benefit in a C plus plus program to add two matrices?

No.


How do you add two matrices using Linux shell script?

write ashell script to add awo matrix using array.


Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.


Write a program to add two 3x3 matrices in vb.net?

Here's a simple VB.NET program to add two 3x3 matrices: Module Module1 Sub Main() Dim matrix1(2, 2) As Integer Dim matrix2(2, 2) As Integer Dim result(2, 2) As Integer ' Initialize matrices (example values) For i As Integer = 0 To 2 For j As Integer = 0 To 2 matrix1(i, j) = i + j matrix2(i, j) = (i + j) * 2 result(i, j) = matrix1(i, j) + matrix2(i, j) Next Next ' Display the result For i As Integer = 0 To 2 For j As Integer = 0 To 2 Console.Write(result(i, j) & " ") Next Console.WriteLine() Next End Sub End Module This program initializes two 3x3 matrices, adds them together, and prints the resulting matrix. You can modify the initialization to use specific values as needed.


Write a program to add two 8 bit numbers in microprocessor 8051?

write it in 8085


What must be true in order to add matrices?

They must have the same dimensions.


How do you add fractions in matrices?

The usual rules of addition of fractions apply.


IN cobol programming language what is the meaning of add AB giving C?

Let c = a+b


Write a c program add two polynomial using link list?

GOUDHMARINI


Write a program in 8051 to add 2 16- bit numbers?

Mov a.#000ff, mov b,#0008f add a,b


How do you add matrices?

You add matrices by adding their respective terms - e.g. the element in the first row and sixth column of the sum is the sum of the elements in the addends' first rows and sixth columns. Wikipedia has a nice example of matrix addition that I linked below.


How do you write and add feature to Gmail?

Just open the program and follow the directions on it. There is a multitude of actions you can perform.