Try this one:
int age;
if(Int32.TryParse(agestring, out age))
{
if (age >= 21)
{
Console.WriteLine("congrats, you're you can get drunk!");
}
else
{
Console.WriteLine("Sorrrrrryyyyyyy =(");
}
}
else
{
Console.WriteLine("Sorry Thats not a valid input");
}
Using the Int32.TryParse
method you can check, if the parsing of the input is successful. If it is not, then you print a message to the console.