Exercise 1: Matrix Multiplication




Document: Software Engineering 1: Course Notes

next Exercise 2: Bubble Sort
up Session 3: Week 5/6
previous Session 3: Week 5/6

Exercise 1: Matrix Multiplication

Program MATMUL multiplies matrices of fixed size (3 rows, 4 columns; 4 rows, 2 columns). Make the program deal with any specified sizes up to an arbitrary 50 by 50.gif

Read three sizes: the number of rows of A, the number of columns of A (implying also the number of rows of B), the number of columns of B. Read A and B by rows, then print C by rows. For this exercise you have to change each simple reading loop to a nested pair of loops. Similarly the printing loop.



McMullin@ugmail.eeng.dcu.ie
Wed Mar 15 10:20:49 GMT 1995