Primitive Calculator using C++
#include <iostream>
using namespace std;
int main()
{
int a, b, Sum, Difference, Multiplication, Division, Op;
cout << "Enter first no. " << endl;
cin >> a;
cout << "Enter second no. " << endl;
cin >> b;
cout << "Choose Operation from below \n Sum \n Difference \n Multiplication \n Division" << endl;
cin >> Op;
if(Op==Sum)
{
cout << "The Sum is " << a + b << endl;
}
else if(Op==Difference)
{
cout << "The difference is " << a -b << endl;
}
else if(Op==Multiplication)
{
cout << "Product is " << a*b << endl;
}
else if(Op==Division)
{
cout << "The quotient is " << endl;
}
return 0;
}
Comments
Post a Comment