A, B, C, and D are two-dimensional arrays , all of the same size ,and all of type double . I need code fragment that computes D = A + B + C, where each element of D is the sum of the corresponding elements of A, B and C. Also two integer variables numRows and numCols that denote the number of rows and columns in each matrix.

Did you try attempting the question?

Two for loops will do the trick.

Until you try to solve the problem, and post your code here, we don't help with homework problems. That said, ddanbe is correct (hint)... :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.