title: Arranging numbers within the digits in descending order without using arrays
body: <p>I want to arrange the digits of a number in descending order without using arrays. When I am using String it gives run time error. 
  For example:</p>
  
  <pre><code>Input: 2436
  Output: 6432
  </code></pre>
  
  <p>Here is what I wrote but the problem is the first digit isn't getting printed which is not the expected output.</p>
  
  <pre><code>public static void main (String[] args) throws java.lang.Exception {
      Scanner sc = new Scanner(System.in);
      int num,n,r=0,FinalNo=0;
      System.out.println("Enter any number");
      num=sc.nextInt();
      n=num;
      while(n&gt;0) {
          r=n%10;
          n=n/10;
          FinalNo=(FinalNo*10)+r;
      }
      System.out.println("The number in descending order is "+FinalNo);
  }   
  </code></pre>