C program to add two 3*3 matrices


















Now add the same positioned elements to form a new matrix. After adding two matrices, display the third matrix which is the addition result of two matrices as shown in the following program. That is, user is allowed to enter 9 elements for first and 9 elements for second matrix. And then add them up to print the third matrix that will be the addition result of given two:.

Now enter any 9 numbers say 1, 2, 3, 4, 5, 6, 7, 8, 9 as the elements of first matrix and then again 9 numbers say 9, 8, 7, 6, 5, 4, 3, 2, 1 as elements of second matrix. Similarly, 9 elements of second matrix also gets stored in similar way. And the addition of two matrix goes in a way that:. Note - To define addition of two matrix, both the matrix must be of same order.

Here same order means, row size of first matrix must be equal to the row size of second matrix and column size of first matrix must also be equal to the column size of second matrix.

Explore C Examples. Access Array Elements Using Pointer. Multiply two Matrices by Passing Matrix to a Function. Find Transpose of a Matrix. Calculate Standard Deviation. Find Largest Element in an Array.

C Multidimensional Arrays. Calculate Average Using Arrays. Share on:. Did you find this article helpful? Sorry about that. How can we improve it? Leave this field blank. Related Examples. C Example Find Transpose of a Matrix.

Get App Get C App.



0コメント

  • 1000 / 1000