Question #258004

Using code block/Dev C++, write any TWO types of operators program separately

Expert's answer

Addition operator

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
   int a,b;
   int sum=0;
   cout<<"Enter the value of a and b: ";
   cin>>a>>b;
   sum=a+b;
   cout<<"Sum of the numbers is: "<<sum;
}


Multiplication operator

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
   int a,b;
   int multiply=0;
   cout<<"Enter the value of a and b: ";
   cin>>a>>b;
   multiply=a*b;
   cout<<"Multiplication of the numbers is: "<<multiply;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS