title: Numbers to words using arrays
body: <p>I am trying to make a simple number to english words program and I've decided to use arrays. However whenever I enter a number greater than 99, I get an error in the third if clause.. What do I need to change to fix that? Here's my code;</p>
  
  <pre><code>    class Program
      {
          static void Main(string[] args)
          {
           string[] uptonineteen = {"Zero","One","Two","Three","Four",
          "Five","Six","Seven","Eight","Nine","Ten",
          "Eleven","Twelve","Thirteen","Fourteen","Fifteen",
          "Sixteen","Seventeen","Eighteen","Nineteen"};
          string[] ten = {"","","Twenty","Thirty","Forty","Fifty",
          "Sixty","Seventy","Eighty","Ninety",};
          Console.WriteLine(" ---------------");
          int i = int.Parse(Console.ReadLine());
              if (i &lt; 20)
              {
                  Console.WriteLine(uptonineteen[i]);
              }
              if (i &lt; 100)
              {
                  Console.WriteLine(ten[i / 10] + ((i % 10 &gt; 0) ? "" + uptonineteen[i%10] : ""));
              }
              if (i &lt;= 999)
              {
                  object lenthree = ten[i / 100] + "hundred"+" " + ((i % 100 &gt; 0) ? "and" +" "+  uptonineteen[i % 1000] : "");
                  Console.WriteLine(lenthree);
              } 
              Console.ReadKey();
          }
      }
  }
  </code></pre>