title: Program for spelling out integer number digits: (in switch statement) does not match case values, why?
body: <p>From the book &quot;Programming in C&quot;</p>
  <blockquote>
  <p>Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English. So, if the user types in 932, the program should display</p>
  <pre><code>nine three two
  </code></pre>
  <p>Remember to display “zero” if the user types in just a <code>0</code>.</p>
  </blockquote>
  <p>Its been hours and its still cant be solved.. Do anyone know how to? This is the code so far</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int right_digit,number;
  
  int main ()
  {    
      scanf(&quot;%i&quot;,&amp;number);
  
      right_digit = number % 10;
      
      switch (right_digit)
      {
          case '0':
              printf(&quot;0&quot;);
              break;
          case '1':
              printf(&quot;one&quot;);
              break;
          case '2':
              printf(&quot;two&quot;);
              break;
          case '3':
              printf(&quot;three&quot;);
              break;
          case '4':
              printf(&quot;four&quot;);
              break;
          case '5':
              printf(&quot;five&quot;);
              break;
          case '6':
              printf(&quot;six&quot;);
              break;
          case '7':
              printf(&quot;seven&quot;);
              break;
          case '8':
              printf(&quot;eight&quot;);
              break;
          case '9':
              printf(&quot;nine&quot;);
              break;
          default:
              break;
      }
      
      number = number / 10;
      
      return 0;
  }
  </code></pre>