c# - What type of logic do I use in this situation? -


i'm coding console application , need add menu. understand basic if statements. how can transfer user different part of programs? sort of :

if (menuoption == 1) {     // transfer menu option 1 } 

what type of logic need use in circumstance ?

use switch menus

//user enters value. var menu = convert.toint32(console.readkey()); switch(menu) {     case 1:        //go menu 1       break;     case 2:        //go menu 2       break; } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -