title: How to sort Integer digits in ascending order without Strings or Arrays?
body: <p>I'm trying to sort the digits of an integer of any length in ascending order without using Strings, arrays or recursion.</p>
  
  <p>Example:</p>
  
  <pre><code>Input: 451467
  Output: 144567
  </code></pre>
  
  <p>I have already figured out how to get each digit of the integer with modulus division:</p>
  
  <pre><code>int number = 4214;
  
  while (number &gt; 0) {
      IO.println(number % 10);
      number = number / 10;
  }
  </code></pre>
  
  <p>but I don't know how to order the digits without an array.</p>
  
  <p>Don't worry about the <code>IO</code> class; it's a custom class our professor gave us.</p>