Same Output. Code reduced by 1/2
// User: ViOLATiON
// Date: September 15th, 2005
// Comments: Basic Calculator
#include <iostream>
using namespace std;
int main()
{
int opchoice;
int numberone;
int numbertwo;
int answer;
// Choose your operation
cout<<"Choose your operation\n\n1 - Multiplication\n2 - Subtraction\n3 - Addition\n4 - Division\n\n"<<endl;
cin>>opchoice;
cout<<"\nPlease input the first number\n\n";
cin>>numberone;
cin.get();
cout<<"\n\nPlease input the second number\n\n";
cin>>numbertwo;
cin.get();
switch(opchoice)
{
case 1:
// Multiplication
answer = numberone * numbertwo;
break;
case 2:
// Subtraction
answer = numberone - numbertwo;
break;
// Addition
case 3:
answer = numberone + numbertwo;
break;
case 4:
//division
answer = numberone / numbertwo;
}
cout<<"\nThe final answer is "<<answer << "\n";
cin.get();
return 0;
}