title: Converting Numbers to English (1-99) in C++
body: <p>Trying to convert numbers into English from 1-99 but I honestly do not know what I am missing out here. Whenever I input a number like 20 it doesn't output Twenty like it should. Any help would be appreciated! :)</p>
  
  <pre><code>    #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  
  int main()
  {
      cout &lt;&lt; "In this program we will convert integers to English" &lt;&lt; endl;
  
      int Number, leftDigit, rightDigit, yes;
      yes = 1;
  
      string ones[] = {" Zero"
                       " One "
                       " Two  "
                       " Three "
                       " Four  "
                       " Five  "
                       " Six   "
                       " Seven "
                       " Eight "
                       " Nine  "
                       " Ten   "
                       " Eleven "
                       " Twelve  "
                       " Thirteen"
                       " Fourteen "
                       " Fifteen  "
                       " Sixteen  "
                       " Seventeen "
                       " Eighteen "
                       " Nineteen " };
  
      string tens[] = {" Twenty "
                       " Thirty "
                       " Fourty  "
                       " Fifty   "
                       " Sixty   "
                       " Seventy "
                       " Eighty  "
                       " Ninety  "};
  do{
      cout &lt;&lt; "Enter any integer value:  " &lt;&lt; endl;
      cin &gt;&gt; Number;
  
      if ( Number &lt;= 0 || Number &gt;= 100 )
      {
          cout &lt;&lt; "The number is not between 1 and 99" &lt;&lt; endl;
      }
      else ( Number &gt;= 1 &amp;&amp; Number &lt;= 19 )
      {
          cout &lt;&lt; "The number you have entered is: " &lt;&lt; ones[Number] &lt;&lt; endl;
      }
      else ( Number &gt;= 20 &amp;&amp; Number &lt;= 99)
      {
          leftDigit = Number / 10;
          rightDigit = Number % 10;
  
          cout &lt;&lt; "The number you have entered is: " &lt;&lt; tens[leftDigit - 2 ] &lt;&lt; " " &lt;&lt; ones[rightDigit] &lt;&lt; endl;
      }
    } while (yes == 1);
  
      return 0;
  }
  </code></pre>