Converting three digit numbers to text
<p>I am having some trouble doing this for the three digit. I can do it for the two digit numbers but when i add an if statement to the string TwoDigit it tells me unreachable code detected.</p>

<pre><code>{
class Program
{
    static string[] digitWords =
    { "zero", "one", "two", "three", "four",
        "five", "six", "seven", "eight", "nine",
        "ten", "eleven", "twelve", "thirteen", "fourteen",
        "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" };

    static string[] tenWords =
    { "", "", "twenty", "thirty", "forty",
      "fifty", "sixty", "seventy", "eighty", "ninety" };

    static string[] hundredWords = { "One-hundred", "two-hundred", "three-hundred", "four-hundred", "five-hundred", "six-hundred", "seven-hundred", "eight-hundred", "nine-hundred"}

    static string TwoDigit(int num)
    {
        if (num &lt; 0 || num &gt; 99) return "";
        if (num &lt; 20) return digitWords[num];
        if (num % 10 == 0)
            return tenWords[num / 10];
        else
            return tenWords[num / 10] + "-" + digitWords[num % 10];

        if (num % 100 == 0)
            return digitWords[num / 100] + "-" + hundredWords[num % 100];
        else
            return digitWords[num / 100] + "-" + hundredWords[num % 100] + "-" + digitWords[num % 100];
    }

    static void Main(string[] args)
    {
        for (int i = 0; i &lt;= 19; i++)
            Console.WriteLine("{0}: {1}", i, TwoDigit(i));
        for (int i = 20; i &lt;= 99; i +=7)
            Console.WriteLine("{0}: {1}", i, TwoDigit(i));
        for (int i = 100; i &lt;= 1100; i += 7)
            Console.WriteLine("{0}: {1}", i, TwoDigit(i));
    }
}
</code></pre>

<p>}</p>
