## Simple Calculator

Code:

```// www.cppfuzz.com
/*

______ .______   .______    _______  __    __   ________   ________
/      ||   _  \  |   _  \  |   ____||  |  |  | |       /  |       /
|  ,----'|  |_)  | |  |_)  | |  |__   |  |  |  | `---/  /   `---/  /
|  |     |   ___/  |   ___/  |   __|  |  |  |  |    /  /       /  /
|  `----.|  |      |  |      |  |     |  `--'  |   /  /----.  /  /----.
\______|| _|      | _|      |__|      \______/   /________| /________|

*/
#include <iostream>
using namespace std;
void main()
{
double num1,num2;
double addition, subtraction, multiplication, division;
int num;
cout << "Enter first number: ";
cin >> num1;
cout << "Enter second number: ";
cin >> num2;
cout << "Press 1 for addition" << endl;
cout << "Press 2 for subtraction" << endl;
cout << "Press 3 for multiplication" << endl;
cout << "Press 4 for division" << endl;
cin >> num;
if (num>4)
{
cout << "Invalid Input, Please Give a Valid Input From 1 to 4: ";
cin >> num;
}
else
{
switch (num)
{
case 1:
{
addition = num1 + num2;
cout << "Result of addition is: " << addition << endl;
}
break;

case 2:
{
subtraction = num1 - num2;
cout << "Result of subtraction is: " << subtraction << endl;
}
break;

case 3:
{
multiplication = num1 * num2;
cout << "Result of multiplication is: " << multiplication << endl;
}
break;

case 4:
{
division = num1 / num2;
cout << "Result of division is: " << division << endl;
}
break;

default:
{
cout << "Invalid Input." << endl;
}
break;
}
}
}```

Copyright @ 2014 CPP Fuzz.