Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int portal_val = 0;
- int params[10];
- int results[10];
- goto prg_start;
- portals:
- switch(portal_val)
- {
- case 0 : goto prg_start;
- case 1 : goto after_f;
- //
- default : goto prg_start;
- }
- start_f:
- results[0] = params[0] * params[0];
- goto portals;
- prg_start:
- int x;
- cout << "enter X:" << endl;
- cin >> x;
- // start sqr func
- params[0] = x;
- portal_val = 1;
- goto start_f;
- after_f:
- int res = results[0];
- cout << "Answer: " << res << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment