# HW8 - MAE9 Homework#8 Fall 2006 Due on Monday November 16...

This preview shows pages 1–2. Sign up to view the full content.

/* MAE9: Homework #8, Fall 2006 Due on Monday, November 16, before 9:00 pm In main(), read the number of rows (=rows) and the number of columns (=cols) from the first row of the file "matrix5.dat". If rows!=cols exit the program. the remaining rows of the file contain the values of matrix a[rows][cols] and the values of b[rows]. Allocate memory for double **a, *b, *c. In a for-loop for each row, read the values for a[row]. Print the values a[][] using %9.3f on the screen. From the file, read the last line as the elements of b[]. Print the values of b[] using %9.3f on the screen. Compute c[] = a[][] * b[] and print the values of c[] using %9.3f. ---------(Output Sample)------------------------------------------------ rows = 7 cols = 7 a[][]: [0] 10.000 9.000 8.000 7.000 6.000 5.000 4.000 [1] 9.000 11.000 -6.000 8.000 3.000 -2.000 5.000 [2] 8.000 -6.000 12.000 10.000 -8.000 -6.000 4.000 [3] 7.000 8.000 10.000 14.000 13.000 -6.000 5.000 [4] 6.000 3.000 -8.000 13.000 16.000 14.000 -9.000 [5]

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

HW8 - MAE9 Homework#8 Fall 2006 Due on Monday November 16...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online