Write a program to add, subtract, multiply two matrices in c++ ?
Answers
Answered by
1
Code for Program to add, subtract and multiply matrix in C++ Programming#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
#include "matrix.cpp"// included in zipvoid main()
{
int choice;
matrix obj;
while(1){
clrscr();
cout<<"\t\tMATRIX OPERATIONS\n\n";
cout<<"\t\t1) Addition\n";
cout<<"\t\t2) Subtraction\n";
cout<<"\t\t3) Multiplication\n";
cout<<"\t\t4) Exit\n";
cout<<"\t\tEnter your Choice : ";
cin>>choice;
switch(choice){
case 1 : obj.matAdd();
break;
case 2 : obj.matSub();
break;
case 3 : obj.matMul();
break;
case 4 : gotoout;
default: cout<<"\n\n\t\tInvalid Choice\n\n";
getch();
break;
}
}
out:
}
jacks:
Only logic
Answered by
1
Take matrix1. And matrix2 matrix 3=a[I][j]+b[I][j]; matrix m[I][j]+=a[I][k]+b[k][j]
Similar questions