In this assignment you are asked to write a program that reads in two matrixes of size n x m and s x t and then it outputs the resulting multiplication of those two matrixes. Since sizes of matrices are not known in advance, you need to implement a dynamic memory allocation scheme for matrices. Your program should prompt the user for n, m, s, t, and the elements of each matrix. After that, if the multiplication can be performed on the matrices, your program should output each matrix and the result of the matrix multiplication.
Recall that if the matrix A is of size n x m, and matrix B is of size m x t, the resulting matrix C would be of size n x t. However, if a matrix is n x m and the other is s x t, these matrices cannot be multiplied if m is not equal to s.
If you are not familiar with the matrix multiplication problem, study the following example in order to find a general solution for the multiplication of two-dimensional matrices. In this example, matrices A and B are of size 3 x 3. An entry Xij indicates an element X[i][j].
A00 A01 A02 B00 B01 B02
A = A10 A11 A12 B = B10 B11 B12
A20 A21 A22 B20 B21 B22
Resulting multiplication of the matrices A and B is equal to
A00 * B00 + A01 * B10 + A02 * B20 A00*B01 + A01 * B11 + A02*B21 A00*B02 + A01 *B12 + A02 *B22
C = A10 * B00 + A11 * B10 + A12 * B20 A10*B01 + A11 * B11 + A12*B21 A10*B02 + A11 *B12 + A12 *B22
A20 * B00 + A21 * B10 + A22 * B20 A20*B01 + A21 * B11 + A22*B21 A20*B02 + A21 *B12 + A22 *B22
To solve the problem, you need to determine how to obtain an entry, say C[i][k], from the entries of matrices A and B. Once you figure this out, the programming will be extremely easy task. Warning; before you start to program, test your solution.