How would I write another function named noNegatives for this code? I want to rewrite the code with another function named noNegatives but I still want the program to do the same thing.
class Program
{
static void Main(string[] args)
{
string numberIn;
int numberOut;
numberIn = Console.ReadLine();
while (!int.TryParse(numberIn, out numberOut) || numberOut < 0)
{
Console.WriteLine("Invalid. Enter a number that's 0 or higher.");
numberIn = Console.ReadLine();
}
}
}