Division stops working for negative numbers
<p>I made it  display the Dividend so that people can decipher the code without much hassle. It worked once but then I don't know what I did to make it stop working. It works perfectly for positive integers. It is supposed to display the number associated with user input.</p>

<pre><code>#include &lt;iostream&gt;                                        // Necessary header
using namespace std;

int main()
{
   signed int Input, Divisor, Dividend, MSD;

   cout &lt;&lt; "Input:";
   cin &gt;&gt; Input;

   Divisor = 1;
   Dividend = Input;
   if (Input &lt; 0)
   {
       Dividend *= -1;
       cout &lt;&lt; "minus ";
   }

   cout &lt;&lt; Dividend;
   while (Dividend &gt; 9)
   {
       Divisor = Divisor * 10;
       Dividend = Dividend / 10;
   }

   while (Divisor != 0)
   {
       MSD = Input / Divisor;
       switch (MSD)
       {
           case 0:
           cout &lt;&lt; "zero ";
           break;
           case 1:
           cout &lt;&lt; "one ";
           break;
           case 2:
           cout &lt;&lt; "two ";
           break;
           case 3:
           cout &lt;&lt; "three ";
           break;
           case 4:
           cout &lt;&lt; "four ";
           break;
           case 5:
           cout &lt;&lt; "five ";
           break;
           case 6:
           cout &lt;&lt; "six ";
           break;
           case 7:
           cout &lt;&lt; "seven ";
           break;
           case 8:
           cout &lt;&lt; "eight ";
           break;
           case 9:
           cout &lt;&lt; "nine ";
           break;
       }
    Input = Input - (MSD * Divisor);
    Divisor /= 10;
   }
   return 0;
}
</code></pre>
