title: C++ Changing a decimal to octal, output backwards
body: <p>So I wrote this small application that will convert a decimal to octal, and it is outputting the right answer only it's backwards. An example would be that if the answer to the conversion was 17, the application would display it as 71. 
  Any help would be much appreciated.</p>
  
  <pre><code>;
      int _tmain(int argc, _TCHAR* argv[])
  {   
  int octal, total = 0;
      cout&lt;&lt; "please enter a decimal: ";
      cin &gt;&gt; octal;
      while(octal &gt; 0)
      {
                  total = octal % 8;
          octal /= 8;
          cout &lt;&lt; total;
      }
      cout &lt;&lt; endl;
          _getche(); 
          return 0;
  }
  </code></pre>