Question: i need help writing this C code. i can not get the output shown in the picture below. please take a look at the whole
i need help writing this C code. i can not get the output shown in the picture below. please take a look at the whole picture. thanks. 
This assignment has six objectives: 1. to use the command line arguments 2. to open a file, input all data from the file, and close the file 3. use double loop to add two NxM matrices 4. use triple loop to multiply two matrices, one is PxQ and the other is QxP 5. to produce formatted output Description Given two integer matrices, you need to perform two matrix operations, addition (A B) and multiplication (CxD). The addition requires both matrices have the same number of rows (N) and columns (M) the multiplication requires the number of rows (P) of matrix C equals to the number of columns of matrix Dand the number of columns (Q) of matrix C equals to the number of rows of matrix D All data are stored in a file and the format of the file as follow: 1) the first line has two numbers, N and M, where Nis the number of rows and Mis the number of columns of both A and B 2) the next N lines each has M elements for one of the rows of A 3) the next N lines each has M elements for one of the rows of B 4) the next line has two numbers, P and Q, where P is the number of rows of C (also number of columns of D) and Q s the number of columns of C (also the number of rows of D 5) the next P lines each has Qelements for one of the rows of C 6) the next Q nes each line has P elements for one of the rows of D Example: 3 4 2 3 1 5 3 1 2 4 1 2 3 4 6 5 4 3 3 3 2 3 7 5 4 3 4 3 2 3 4 3 4 5 4 5 6 1 2 3 3 4 5 6 4 5 6 7 4 3 2 1 Means both matrices A and Bare 3 x 4 matrix, C is 4 x 3 matrix, and Dis 4 x 3 matrix, Matrix A has three rows, 2 315, 3124, and 3 124. Matrix B has three rows, 654 3,3 3 2 3, 75 4 3, Matrix C has four rows, 2 3 4, 3 4 5, 4 5 6, 1 2 3. Matrix D has three rows, 3 4 5 6, 45 67, 4 321 Instructions You need to open the data file (example file name Ma x.tx input the numbers of rows and columns and then input the rest elements of both matrices A and B. Continue input the numbers of rows and columns and then input the rest elements for matrices Cand D. Output the result of your addition and multiplication. You may define your matrices either using larger dimension (say 30) or using dynamic memory allocation (for 20 extra points). The output of your result should has the followings. The result of addition: The result of multiplication: 34 35 36 37 45 47 49 51 62 56 59 65 23 23 23 23
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
