Okay, I'm just doing a bit of a revision in programming so bear with me. Here's what I'm trying. As you can see, if I choose 1, the output will be a continuous "You picked 1"s . So what I'm trying to do is looping through the switches e.g If I choose a number, it will output the number I chose and still give me the option to choose a number again.
Code:#include <iostream> using namespace std; void main() { int num; cout << "1: Task1" << endl; cout << "2: Task2" << endl; cout << "0: exit" << endl; cout << "Please choose a number" << endl; cin >> num; while(num!=0) { switch(num) { case 1: cout <<"You picked 1" << endl; break; case 2: cout <<"You picked 2" << endl; break; default: cout <<"Please choose number 1 or 2" << endl; } } cout << "You're outside the loop" << endl; }