CSCI2500-Homework 1 Matrix Multiplication in C Solved
you will implement matrix multiplication.
Command-Line Arguments Four command-line arguments are required (i.e., argv[1] through argv[4]). The first two commandline arguments specify how many rows and columns are in the first matrix, and the second two command-line arguments specify how many rows and columns are in the second matrix. To properly translate the command-line arguments, use the atoi() function, which you can learn more about by checking out the man page.
Once the pair of matrix dimensions are identified and validated, prompt the user to enter the values (non-negative integers) of each matrix. Use scanf() to read in the appropriate values.
Example Program Execution On the next page are example program executions that you can use to better understand how your program should work and how you can begin to test your code. Note that your program must properly return either EXIT_SUCCESS or EXIT_FAILURE, which you can verify via echo$?.
Also, be sure to match the output formatting exactly as shown (to ensure full credit on Submitty). In particular, when displaying a matrix, each line must start with ‘[’ and end with ‘]’ (as shown below). Further, right justify and vertically line up your columns as follows:
[12 34 5567]
[ 8 9 123]
[45 67 8]
[ 9 10 11]
Example program executions are shown below:
bash$ ./a.out 2 3 3 1
Please enter the values for the first matrix (2x3):
1 2 3
4 5 6
Please enter the values for the second matrix (3x1):