Question: USE C PROGRAMMING LANGUAGE This program will test your ability to manage memory using malloc) and provide some experience dealing with 2D arrays in C.

USE C PROGRAMMING LANGUAGE

USE C PROGRAMMING LANGUAGE This program will test your ability to manage

This program will test your ability to manage memory using malloc) and provide some experience dealing with 2D arrays in C. Your task is to create a program that multiplies two matrices and outputs the resulting matrix. The input matrices can be the same or different sizes. Input-Output format: Your program will take the file name as input. The first line in the file will provide the number of rows and columns in the matrix separated by a tab. The subsequent lines will provide the contents of the matrix. The numbers in the same row are tab separated and the rows are separated with new lines. This will be followed by the same format for the dimensions and content of the second matrix For example, a sample input file "filel.txt": 1 2 3 4 5 6 3 2 1 2 3 4 The first number (2) refers to the number of rows and the second number (3) refers to the number of columns in the matrix. The dimensions of the of the first matrix will be 2x3 and the second matrix will be 3x2. The output on executing the program with the above input is shown below. The outputted numbers should be tab separated in the same row with a newline between rows. There should not be extra tabs or spaces at the end of the line or at the end of the file $./fourth file1.txt 22 28 49 64 We will not give you improperly formatted files. You can assume all your input files will be in proper format as above with no matrix having 0 rows or columns For matrices that cannot be multiplied your program should output "bad-matrix

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!