Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int func(void) {
- int b;
- int c;
- int r;
- cout << " hello enter a number " << endl;
- cin >> b;
- cout << " enter another number " << endl;
- cin >> c;
- r = b + c;
- return r;
- }
- int main(int argc, char * argv[]) {
- int t(0);
- cout << " Hello world would you like to play a little game? if so type 0 if no 1 " << endl;
- cin >> t;
- if (t == 0) {
- int r = func();
- cout << " the result is " << r << endl;
- }
- else if (t == 1) {
- cout << " thanks for typing 1 bye " << endl;
- }
- else {
- cout << " see you later!" << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment