Question: Write a program in C that does the following: Prompt the user to enter the number of rows and columns of a matrix. Dynamically allocate
Write a program in C that does the following:
- Prompt the user to enter the number of rows and columns of a matrix.
- Dynamically allocate an array to contain the appropriate number of terms (your choice of data type).
- Prompt the user to enter the values for the matrix, and store them in memory as they are entered.
- Print back the matrix (in matrix format) to the screen.
For example, if the user says that a matrix has 3 rows and 5 columns, the allocated array would have 15 terms.
The user would then be prompted to enter 15 values, and upon doing so, would see the matrix displayed on the screen in a 3x5 format.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
