0
How can i make a user input
im trying to use all stuff i have gone throught to make a simple program to learn more but im stuck, since if i try to use the user input people would be able to type in letters and i only want them to be able to put in numbers from 1-3. to keep it simple and i still want to keep the switch cource in my program this is my first go on the program. http://www.sololearn.com/app/csharp/playground/cc8DL50PtG7h/
3 Respostas
0
string input;
while (true)
{
input = Console.ReadLine();
if (input == "1" or input == "2" or input == "3")
{
break;
}
Console.WriteLine("Pleas enter a valid input");
}
Then you can cast input to integer if you need to.
0
thank you so much
0
you are welcome ^_^