Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
User input for an integer
int X;
String Result = Console.ReadLine();
while(!Int32.TryParse(Result, out X))
Console.WriteLine("Not a valid number, try again.");
Result = Console.ReadLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment