Calculator Program
// Hi Guys! //
/* I have created a Simple Calculator >> see this interesting calculator and calculate your mathematical terms here! */
// Upvote and Comment //
#include <iostream>
using namespace std;
int main()
{
char op;
float num1, num2, result;
cout << "Enter the Operator +(Add) or -(substract) or *(Multiply) or /:(divide)\n"; // Choose only one Operator from this only at one time //
cin>>op;
cout << "Enter the First No:" << endl;
cin>>num1;
cout << "Enter the Second No:" << endl;
cin>>num2;
switch(op)
{
case '+':
cout << "Result:";
cout <<num1+num2<<"\nCreated by H@rsh"<< endl;
break;
case '-':
cout << "Result:";
cout << num1-num2<<"\nCreated by H@rsh"<< endl;
break;
case '*':
cout << "Result:";
cout << num1*num2<<"\nCreated by H@rsh"<< endl;
break;
case '/':
cout << "Result:";
cout << num1/num2<<"\nCreated by H@rsh"<< endl;
break;
default:
// If the Operator other than +,-,*,/, Error Input //
cout << "Error Input Operator" << endl;
break;
}
return 0;
}
follow this Instructions
1. first Input the Operator (+or-or*or/) in Submit Multiples
2. Enter the First no and go in new line
3. Enter the Second no
4. Click on the submit button and see the Result.
Now Run it on the Link given below...https://code.sololearn.com/cOUc7lkU93tS
/* I have created a Simple Calculator >> see this interesting calculator and calculate your mathematical terms here! */
// Upvote and Comment //
#include <iostream>
using namespace std;
int main()
{
char op;
float num1, num2, result;
cout << "Enter the Operator +(Add) or -(substract) or *(Multiply) or /:(divide)\n"; // Choose only one Operator from this only at one time //
cin>>op;
cout << "Enter the First No:" << endl;
cin>>num1;
cout << "Enter the Second No:" << endl;
cin>>num2;
switch(op)
{
case '+':
cout << "Result:";
cout <<num1+num2<<"\nCreated by H@rsh"<< endl;
break;
case '-':
cout << "Result:";
cout << num1-num2<<"\nCreated by H@rsh"<< endl;
break;
case '*':
cout << "Result:";
cout << num1*num2<<"\nCreated by H@rsh"<< endl;
break;
case '/':
cout << "Result:";
cout << num1/num2<<"\nCreated by H@rsh"<< endl;
break;
default:
// If the Operator other than +,-,*,/, Error Input //
cout << "Error Input Operator" << endl;
break;
}
return 0;
}
follow this Instructions
1. first Input the Operator (+or-or*or/) in Submit Multiples
2. Enter the First no and go in new line
3. Enter the Second no
4. Click on the submit button and see the Result.
Now Run it on the Link given below...https://code.sololearn.com/cOUc7lkU93tS
Nice work...#Hurricane keep going like this man...u will succeed in if u work like this..👍👌
ReplyDeleteNice work...#Hurricane keep going like this man...u will succeed in if u work like this..👍👌
ReplyDeleteWell done and keep going.......
ReplyDelete