Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <windows.h>
- using namespace std;
- string answer;
- int a;
- int calc(){
- int b;
- int c;
- int d;
- int e;
- int f;
- cout << "Enter a Number: ";
- cin >> a;
- cout << "Enter a 2nd Number: ";
- cin >> b;
- cout << "\n";
- c = a+b;
- d = a-b;
- e = a*b;
- f = a/b;
- cout << "The sum is: " << c << endl << endl;
- cout << "The subtraction is: " << d << endl << endl;
- cout << "The solution is: " << e << endl << endl;
- cout << "The divison answer is: " << f << endl << endl;
- return 0;
- }
- int main(){
- cout << "Woud you like to use the Calculator?" << endl;
- cin >> answer;
- if(answer == "yes"){
- cout << "Here's a simple Addition Math Problem" << endl;
- calc();
- cin.get();
- }
- else{
- cout << "damn" << endl;
- cin.get();
- return 0;
- }
- main();
- cin.get();
- return 0;
- }
Add Comment
Please, Sign In to add comment