0% found this document useful (0 votes)
12 views2 pages

Program2 Multiplying Two Matrices

Algorithic outline for multiplying two matrices

Uploaded by

Vinod Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Program2 Multiplying Two Matrices

Algorithic outline for multiplying two matrices

Uploaded by

Vinod Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Program -2

Object: Multiplication of two matrices using functions.

Summary

1. Give a concept about functions with calling methods (describe in one page)
2. Give a concept of 2-dimensional array .

Hints/ pseudocode/ Algorithm for multiplying of two matrices using functions.

read_matrix (argument1, argument2, argument3..)

Read elements for 2-dimensional array matrices matrix1 and again for matrix2

multiply_matrix (argument1, argument2, argument3..)

multiply elements of 2-dimensional array matrices matrix1 and matrix2 and save into matrix3

print_matrix(argument1, argument2, argument3..)

Print the contents of matrix passed

main()

1. Define three 2-dimensional arrays representing matrices of same sizes named as matrix1,
matrix2, matrix3. (we have to calculate value as matricx3 = matrix1+ matrix2)
2. Take required number of rows and columns in matrices
3. Call a function to read values for matrix1 named as “read_matrix” pass the required
arguments.
4. Call a function to read values for matrix2 named as “read_matrix” pass the required
arguments.
5. Call a function to multiply matrix1 and matrix2 named as “multiply_matrix” pass the
required arguments.
6. Call a function to print contents of matrix1 named as “print_matrix pass the required
arguments.
7. Call a function to print contents of matrix2 named as “print_matrix pass the required
arguments.
8. Call a function to print contents of matrix3 named as “print_matrix pass the required
arguments.

…………………………………………………………………………………………………………………………………………………………….

Running program code

-----------------------------------------------------------------------------------------------------------------------------------
Output

You might also like