I just started on a project on c++ and I was wondering if it is possible to add a select option (where the c++ program requires the user to select an option) . I couldn't find this anywere.
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main(){
int choice(0);
cout << "Hello human. Please select one of the following choices:\n"
<< "\t1) Say hi \n\t2) Say bye \n\t3) Explosion \n"
<< "Your choice: ";
cin >> choice;
switch(choice){
case 1:
cout << "Hello again." << endl;
break;
case 2:
cout << "Goodbye." << endl;
break;
case 3:
cout << "BWAAAAAGHHHH" << endl;
break;
default:
break;
}
return 0;
}