Matrix Addition in C++

Matrix Addition in C++

Here in this program, we will learn the concept of matrix addition. First we will get size of matrix, Input elements of matrix 1 and matrix 2, calculate the addition of matrix, and print the matrix 3 as result. This program will be a good example of 2d array.

This program is only possible if two matrix have same dimensions.

Program:

Output:

Enter No of Rows & Columns (max : 5,5) :2
2

Enter Elements for 1st Matrix : 1
2
3
4

Enter Elements for 2nd Matrix : 1
2
3
4

The Elements In 1st Matrix :

1 2
3 4

The Elements In 2nd Matrix :

1 2
3 4

The Elements After Addition :

2 4
6 8

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top