0
How to return to menu with switch case statement?
I am trying to find a way how to return case 3 back to the top of the code to output the same thing again after the user enter case 3. How do I do this? https://code.sololearn.com/csETbpgnARgZ/?ref=app
2 Respuestas
+ 1
The only way to so this is on a loop and switch doesn't do that, my advice is to change it to a while loop.
But if you reeeaaally want to use a switch case you can do something a little bit silly: recursion with Main. It would be something like this:
case 3:
Console.WriteLine("Coming soon!");
Main(new String[0]);
break;
I'm not sure if I helped but Keep the good coding :)
0
Great!
Thanks for your help 👍🏼