#include<iostream.h>
#include<conio.h>
#include<process.h>
class mat
{
int a[20][20],b[20][20],c[20];
int i,j,k,p,q,x,y;
public:
void addition(void);
void substraction(void);
void multiplication(void);
};
void mat::addition()
{
cout<<"\nENTER THE DIMENSION OF MATRIX A::\t";
cin>>x>>y;
cout<<"\nENTER THE DIMENSION OF MATRIX b::\t";
cin>>p>>q;
if((x==p)&&(y==q))
{
cout<<"\nENTER THE"<<x<<"*"<<y<<"ELEMENTS OF MATRIX A::\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
cin>>a[i][j];
}
cout<<"\nENTER THE"<<p<<"*"<<q<<"ELEMENTS OF MATRIX B::\n";
for(i=0;i<p;i++)
{
for(j=0;j<q;j++)
cin>>b[i][j];
}
cout<<"\nSUM OF MATRIX A & B::\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
c[i][j]=a[i][j]+b[i][j];
}
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
cout<<c[i][j]<<"\t";
cout<<"\n";
}
}
else
cout<<"\nADDITION IS NOT POSSIBLE::";
}
void mat::substraction()
{
cout<<"\nENTER THE DIMENSION OF MATRIX A::\t";
cin>>x>>y;
cout<<"\nENTER THE DIMENSION OF MATRIX b::\t";
cin>>p>>q;
if((x==p)&&(y==q))
{
cout<<"\nENTER THE"<<x<<"*"<<y<<"ELEMENTS OF MATRIX A::\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
cin>>a[i][j];
}
cout<<"\nENTER THE"<<p<<"*"<<q<<"ELEMENTS OF MATRIX B::\n";
for(i=0;i<p;i++)
{
for(j=0;j<q;j++)
cin>>b[i][j];
}
cout<<"\nDIFFERENCE OF THE MATRIX A & B::\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
c[i][j]=a[i][j]-b[i][j];
}
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
cout<<c[i][j]<<"\t";
cout<<"\n";
}
}
else
cout<<"\nSUBSTRACTION IS NOT POSSIBLE::";
}
void mat::multiplication()
{
cout<<"\nENTER THE DIMENSION OF MATRIX A::\t";
cin>>x>>y;
cout<<"\nENTER THE DIMENSION OF MATRIX b::\t";
cin>>p>>q;
if(y==q)
{
cout<<"\nENTER THE"<<x<<"*"<<y<<"ELEMENTS OF MATRIX A::\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
cin>>a[i][j];
}
cout<<"\nENTER THE"<<p<<"*"<<q<<"ELEMENTS OF MATRIX B::\n";
for(i=0;i<p;i++)
{
for(j=0;j<q;j++)
cin>>b[i][j];
}
cout<<"\nPROCUCT OF THE MATRIX A & B::\n";
for(i=0;i<x;i++)
{
for(j=0;j<q;j++)
{
c[i][j]=0;
for(k=0;k<y;k++)
c[i][j]=a[i][k]*b[k][i]+c[i][j];
}
}
for(i=0;i<x;i++)
{
for(j=0;j<q;j++)
cout<<c[i][j]<<"\t";
cout<<"\n";
}
}
else
cout<<"\nMULTIPLICATION IS NOT POSSIBLE::";
}
void main()
{
int c;
char ch;
mat M;
do
{
clrscr();
cout<<"\t\tMATRIX OPERATION\n\n";
cout<<"\n1.ADDITION\n2.SUBSTRACTION\n3.MULTIPLICATION\n";
cout<<"\nENTER YOUR CHOICE::\t";
cin>>c;
switch(c)
{
case 1:
M.addition()
break;
case 2:
M.substraction()
break;
case 2:
M.multiplication()
break;
default;
cout<<"Wrong Choice";
}
cout<<"\nDoyou want to continue[y/n]::\t";
cin>>ch;
}
while(ch=='y'ch=='Y');
getch();
}
+ addition - subtraction* multiplication
An operator in C# performs a specific operation like addition, subtraction, multiplication etc.
Mathematical operators have the standard precedence: parenthesis (brackets), orders (powers), multiplication/division, addition/subtraction. x + y * z implies x + (y * z) because multiplication has higher precedence than addition. When two operators have the same precedence (such as addition and subtraction), they are evaluated left to right. Thus x - y + z implies (x - y) + z.
There are many: addition, subtraction, multiplication and division are the most common. Each of these operators acts on two numbers to produce a third (which may not be different).
C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion
Inverse Operations: Divison undoes multiplication. Addition undoes subtraction. Subtraction undoes addition. Multiplication undoes division.
Addition, subtraction and multiplication.
the fundamental operations in math are, addition +, subtraction -, division /,and multiplication x ..
The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).The answer will depend on how the information was entered - in pounds (or ponds) or in pennies, what the operations were - addition/subtraction or -multiplication/division).
Do (multiplication/division) before you do (addition/subtraction).
They are: addition, subtraction, division and multiplication
multiplication-addition-subtraction-division
+ - addition _ - subtraction * - multiplication / - division
addition,subtraction,multiplication,division
Arithmetic is the process of applying the four basic operations: addition, subtraction, multiplication and division to numbers.
Multiplication, Division, Subtraction, Addition and the carrot(^) making the following number an exponent or exponential number
addition,subtraction multiplication,division.