For the program, if the user enters anything other than a number that's 0 or higher then the program would say "Invalid. Enter a number that's 0 or higher." The program would then continue to say "Invalid. Enter a number that's 0 or higher." again and again until a number of 0 or higher is entered.
The problem is that if I enter a letter the program does not respond with "Invalid. Enter a number that's 0 or higher."
This is all I can do so far:
class Program
{
static void Main(string[] args)
{
string numberIn;
int numberOut;
numberIn = Console.ReadLine();
if (int.TryParse(numberIn, out numberOut))
{
if (numberOut < 0)
{
Console.WriteLine("Invalid. Enter a number that's 0 or higher.");
Console.ReadLine();
}
}
}
}