Question: Make a function to add matrices, inputting, and displaying the matrices. It can be 2D array of any size (say Max dimension for both row
Make a function to add matrices, inputting, and displaying the matrices.
It can be 2D array of any size (say Max dimension for both row and Column be 10). So, to prevent users from having to entering 100 (for a 10X10 matrix) elements every time (even for a smaller matrix), you should ask for the number of rows and columns in the matrix before the user would input the values of the matrix elements. Basically, your code should be generic. The point is user should be free to enter 2X3, or 4X2, or 9X9 Matrix. If the operation is not supported (ex. adding two arrays of different dimensions) just print out that the operation is not supported and return to the menu.

matrix! # of rows: 2 matrix! # of columns: 2 Enter element (0,0):1 Enter element (0,1):2 Enter element (1,0):2 Enter element (1,1): 1 1 2 2 1 matria2 # of rows: 2 matrix2 # of columns: 2 Enter element (0,0): 2 Enter element (0,1): 3 Enter element (1,0:3 Enter element (1,1: 4 2 3 3 4 3 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
