public static void Main(String[] args)
while (userInput < 0 || userInput > 999)
Console.WriteLine("This is not a number between 0 and 999 ");
Console.WriteLine("Enter a number between 0 and 999: ");
onesPlace = userInput % 10;
tensPlace = (int) ((double) userInput / 10 % 10);
hundredsPlace = (int) ((double) userInput / 100 % 10);
word1 = onesPlace(onesPlace);
word2 = tensPlace(tensPlace);
word3 = hundredsPlace(hundredsPlace);
Foo = tensPlace * 10 + onesPlace;
if (Foo > 10 && Foo < 20)
result = tensPlace(tensPlace);
Console.WriteLine("result = " + result);
Console.WriteLine("word1 = " + word1);
Console.WriteLine("word2 = " + word2);
Console.WriteLine("word3 = " + word3);
Console.WriteLine("foo equals " + Foo);
private static String hundredsPlace(int c)
result = onesPlace(c) + " hundred";
private static String onesPlace(int A)
private static String teens(int b)
private static String tensPlace(int b)
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();