Matrix is 2D array in computer science. Take user input for row and colum. Allocate two 2D dynamic array A and B, first allocate pointes for row elemnets and then allocate columns elements and assign each column pointers to row list.
Now populate elements for matrix A with user input. Then do the same for matrix B. Now take element[0,0] from A and B and add them.
Repeat the same for rest of all positions individually. Thus the resultant matrix is formed.