Write a menu program that lets the user select from a list of options, and if the input is not one
of the options,reprint the list.
Is this program correct?..i can execute this program but can this code be made simple?
Code:#include<iostream> using namespace std; int main() { int option; for(int option; ;) { cout<<"1.apple"<<'\n'<<"2.mango"<<'\n'<<"3.grape"<<'\n'<<"4.orange"<<'\n'<<"5.banana"<<'\n'; cout<<"select any one of the option listed above(enter the number of your option):\n"; cin>>option; for(option;option<6;) { if(option==1) { cout<<"apple\n"; break; } else if(option==2) { cout<<"mango\n"; break; } else if(option==3) { cout<<"grape\n"; break; } else if(option==4) { cout<<"orange\n"; break; } else if(option==5) { cout<<"banana\n"; break; } else { cout<<"enter the number again:\n"; } } } }