Write matrix addition with logical dimensions

Write a complete program for adding two equally shaped matrices. Input gives rows and cols, each 1..3, then all entries of A in row-major order followed by all entries of B in row-major order. Entries lie in [-20,20]. Use fixed-capacity int arrays [3][3] and traverse only the requested rectangle. Print the sum matrix with one space between values, no leading/trailing spaces, and one row per line. For the named rectangle sample, input is 2 3 / 1 2 3 / 4 5 6 / 6 5 4 / 3 2 1. State the dimension condition for addition, and distinguish the allocated row width from the logical number of columns.


