title: Converting from base 10 to any base between 2 and 36
body: <p>I'm writing a C++ code that converts an unsigned base 10 integer to any other base between 2 and 36. I haven't coded in a while so I'm kind of re-learning everything. My questions are: how can I keep it to just printf, without the cout at the end, and still display the ascii value. And is it possible to make it simple(basic).Sorry if I didn't format properly.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main() 
  {
      int InitialNum, BaseNum, Num, x;
      string FinalNum, Temp;
  
      printf("Enter an unsigned integer of base ten: \n");//Prompt user for     input
      scanf_s("%d", &amp;InitialNum);
      printf("Enter the base you want to convert to (min2, max36): \n");
      scanf_s("%d", &amp;BaseNum);            
      x = InitialNum; //save the base 10 number to display at the end
  
  
      while (InitialNum != 0) //continue dividing until original input is 0
      {              
          Num = InitialNum % BaseNum;  //save remainder to Num                         
          int ascii = 48; //declare conversion variable (from int to char)            
          for (int i = 0; i &lt; 32; ++i)//for loop converts Num from int 0-15 to char '0'-'9', 'A'-'F'
          {
              if(Num == i)
              Temp = ascii;                 
              ascii += 1;                                 
              if (ascii == 58)//skip from 9 to A on the ascii table and continue
              ascii = 65;
          }                         
          FinalNum = Temp + FinalNum;//add to the final answer(additions to the left)                       
          InitialNum /= BaseNum; //the initial base10 number gets divided by the base and saved as the quotient              
      }        
      printf("The number %d converted to base %d is:", x, BaseNum); 
      cout&lt;&lt;(FinalNum);
      system("PAUSE");
      return 0;
  }
  </code></pre>