From 21e0807452a1f86c6dc9f8bb821bd26e02eb8cb0 Mon Sep 17 00:00:00 2001 From: Kelash <58991510+KumarKelashMeghwar@users.noreply.github.com> Date: Sat, 23 Oct 2021 14:12:36 +0500 Subject: [PATCH 1/2] Adding some cpp programs --- matrix calculator.cpp | 128 ++++++++++++++++++++++++++++++++++++++++++ time conversion.cpp | 14 +++++ 2 files changed, 142 insertions(+) create mode 100644 matrix calculator.cpp create mode 100644 time conversion.cpp diff --git a/matrix calculator.cpp b/matrix calculator.cpp new file mode 100644 index 0000000..a6a8139 --- /dev/null +++ b/matrix calculator.cpp @@ -0,0 +1,128 @@ +#include +#include +using namespace std; + +void setmatrix(int array[3][3]) + { + cout<<"Enter Values:\n"; + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + cout<<"("<>array[i][j]; + } + } + } + +void showmatrix(int array[3][3]) + { + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + {cout<>c; + switch(c) + { + case '*': + matrixmultiplication(A,B); + break; + + case '+': + matrixaddition(A,B); + break; + + case '-': + matrixsubtraction(A,B); + break; + + case '/': + matrixdivision(A,B); + break; + + default: + cout<<"Invalid operator!!!"; + + } + cout<<"\nDo u want to perform another operation again(y/n)? :"; + cin>>doagain; + } + + +} diff --git a/time conversion.cpp b/time conversion.cpp new file mode 100644 index 0000000..ef88c94 --- /dev/null +++ b/time conversion.cpp @@ -0,0 +1,14 @@ +#include +#include +using namespace std; +int main() +{ int hours,secs,mins; +cout<<"Enter no of hours= "; +cin>>hours; +mins=hours*60; +cout<<"Mins in given hours= "<