Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void name1(){}
- void name2(){}
- void name3(){}
- int main(){
- //Main Menu
- while(true){
- int option;
- cout<<"LOOP SIMULATION MENU";
- cout<<endl<<"[1] name1";
- cout<<endl<<"[2] name2";
- cout<<endl<<"[3] name3";
- cout<<endl<<"Option: ";
- cin>>option;
- cout<<option;
- switch(option){ //Main Menu Backend
- case 1:
- name1();
- system("cls");
- break;
- case 2:
- name2();
- system("cls");
- break;
- case 3:
- name3();
- system("cls");
- break;
- default: // When invalid option selected. Continues the while loop which returns you to the menu screen.
- system("cls");
- cout<<"\nInput a correct choice\n\n";
- continue;
- }
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement