Question: Develop a C# program (name it AddMatrices) that adds two matrices. The matrices must of the same size. The program defines method Addition() that takes

Develop a C# program (name it AddMatrices) that adds two matrices. The matrices must of the same size. The program defines method Addition() that takes two two-dimensional arrays of integers and returns their addition as a two-dimensional array. The program main method defines two 3-by-3 arrays of type integer. The method prompts the user to initialize the arrays. Then it calls method Addition(). Finally, it prints out the array retuned by method Addition(). Document your code, and organize and space the outputs properly as shown below.

Sample run 1:

Matrix A:

2 1 2

7 1 8

3 20 3

Matrix B:

1 1 1

1 1 1

1 1 1

A + B:

3 2 3

8 2 9

4 21 4

Sample run 2:

Matrix A:

2 2 2

2 2 2

2 2 2

Matrix B:

2 2 2

2 2 2

2 2 2

A + B:

4 4 4

4 4 4

4 4 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!