Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void Addition(){
- int pl;
- int ck;
- int sum;
- cout << "Please enter a number!" << endl;
- cin >> pl;
- cout << "Please enter a second number!" << endl;
- cin >> ck;
- sum = pl + ck;
- cout << "The sum of these two numbers is " << sum << " !!!" << endl;
- }
- void Subtraction(){
- int lp;
- int kc;
- int diff;
- cout << "Please enter a number!" << endl;
- cin >> lp;
- cout << "Please enter a second number!" << endl;
- cin >> kc;
- diff = lp - kc;
- cout << "The difference is " << diff << " !!!" << endl;
- }
- int main()
- {
- int a;
- cout << "Type 1 for Addition or 2 for subtraction" << endl;
- cin >> a;
- if(a == 1) {
- Addition();
- }else{
- Subtraction();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement