Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- int operatornum;
- double a, b, c;
- int d = 1;
- /*
- ______ _
- / _____) | |
- ( (____ ___ ____ ___ | | _ _ _ _____
- \____ \ / _ \ / ___) _ \| |_/ ) | | (____ |
- _____) ) |_| | | | |_| | _ (| |_| / ___ |
- (______/ \___/|_| \___/|_| \_)\__ \_____|
- (____/
- */
- while (d == 1){
- cout << " ______ _" << endl;
- cout << " / _____) | |" << endl;
- cout << "( (____ ___ ____ ___ | | _ _ _ _____" << endl;
- cout << " \\____ \\ / _ \\ / ___) _ \\| |_/ ) | | (____ |" << endl;
- cout << " _____) ) |_| | | | |_| | _ (| |_| / ___ |" << endl;
- cout << "(______/ \\___/|_| \\___/|_| \\_)\\__ \\_____|" << endl;
- cout << " (____/" << endl;
- cout << " Calculator" << endl;
- cout << "\nSelect your operator!" << endl;
- cout << "1 - Addition \n" << "2 - Subtraction \n" << "3 - Multiplication \n" << "4 - Division \n";
- cout << "\nOperator:";
- cin >> operatornum;
- cout << "\nEnter First Integer: ";
- cin >> a;
- cout << "Enter Second Integer: ";
- cin >> b;
- if (operatornum == 1){
- c = a+b;
- }
- if (operatornum == 2){
- c = a-b;
- }
- if (operatornum == 3){
- c = a*b;
- }
- if (operatornum == 4){
- if(b==0){
- cout << "*earth blows up*\n";
- system("pause");
- system("cls");
- main();
- }
- c = a / b;
- }
- cout << "\nThe Answer is " << c << endl;
- system("pause");
- system("cls");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement