From 112fe35a50486ab472ef07b2bb81fbee9d84bce7 Mon Sep 17 00:00:00 2001 From: malvika02 <53332650+malvika02@users.noreply.github.com> Date: Mon, 25 Oct 2021 11:44:03 +0530 Subject: [PATCH] Create Matrix-Calculator.cpp --- Maths/Matrix-Calculator.cpp | 85 +++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Maths/Matrix-Calculator.cpp diff --git a/Maths/Matrix-Calculator.cpp b/Maths/Matrix-Calculator.cpp new file mode 100644 index 00000000..d44d2ba2 --- /dev/null +++ b/Maths/Matrix-Calculator.cpp @@ -0,0 +1,85 @@ +#include +#include +#include + +int main() +{ clrscr(); + int arr1[20][20],arr2[10][10]; + int result[20][20]; + int m,n; + int i,j; + // prompts the user to enter the rows and columns of the matrix + cout<<" Enter the number of rows (m) : "; + cin>>m; + cout<<" Enter the number of columns (n) : "; + cin>>n; + cout<<" \n Enter the elements of the 1st matrix \n "; + + for (i=0; i "; + cin>>arr1[i][j]; + } + } + + cout<<"\n Enter the elements of the 2nd matrix : \n "; + for (i=0; i "; + cin>>arr2[i][j]; + } + } + + //------------ display matrics ----------------------- + + cout<<"\n 1st matrix \n "; + for (i=0; i