public static void Main(String[] args)
Console.WriteLine("Enter a number between 0 and 999: ");
input(out originalInput);
digit1 = (int) ((double) originalInput / 100 % 10);
digit2 = (int) ((double) originalInput / 10 % 10);
digit3 = originalInput % 10;
digit4 = (int) ((double) originalInput / 1000 % 10);
Console.WriteLine("This is not a number between 0 and 999");
hundreds = "one hundred ";
hundreds = "two hundred ";
hundreds = "three hundred ";
hundreds = "four hundred ";
hundreds = "five hundred ";
hundreds = "six hundred ";
hundreds = "seven hundred ";
hundreds = "eight hundred ";
hundreds = "nine hundred ";
Console.WriteLine("The number you entered was " + hundreds + tens + ones);
private static void input(out double result)
while (!double.TryParse(Console.ReadLine(), out result));
private static void input(out int result)
while (!int.TryParse(Console.ReadLine(), out result));
private static void input(out Boolean result)
while (!Boolean.TryParse(Console.ReadLine(), out result));
private static void input(out string result)
result = Console.ReadLine();