title: Sorting 3 Numbers from Least to Greatest
body: <p>As part of a problem set I have to sort 3 numbers in ascending order. A simple enough task, but for some reason I'm not getting the expected result. Using arrays is not allowed. Below is my code; I've linked to my flowchart <a href="https://drive.google.com/open?id=1841dhtn7lLHe6lgRl9UCpe8dEZOmCVQ6" rel="nofollow noreferrer">here</a>.  I cannot get the program to sort 3 numbers such as 5, 5, and -4. When I attempt that case, here is the output: </p>
  
  <pre><code>Enter three numbers.
  </code></pre>
  
  <p>In order -0.04 5.0 5.0In order 5.0 -0.04 5.0</p>
  
  <p>If I get that one to work, I cannot get the case of 23, 0, 39 to sort. Not sure if I have over-complicated the attempt with so many cases; I feel that  my flowchart covers all possibilities. Thanks in advance!</p>
  
  <pre><code>  import java.util.Scanner; 
  
  class Main {
    public static void main(String[] args) {
  
      Scanner reader = new Scanner(System.in); 
      System.out.print("Enter three numbers.");
  
      double x = reader.nextDouble();
      double y = reader.nextDouble(); 
      double z = reader.nextDouble();
  
      if (x &gt;= y){
              if (y &gt;= z)
                  System.out.print("In order " + z + " "+ y + " " + x);
  
              if  (z &gt;= x)
                  System.out.print("In order " + y + " "+ x + " " + z);
  
              if (x &gt; z)
                  System.out.print("In order " + y + " " + z + " " + x);
      }
  
      if (y &gt; x)
      {
              if (z &gt;= y)
                  System.out.print("In order " + x + " " + y + " "+ z);
          if (z &gt;= x)
              System.out.print("In order " + y + " " + x + " " + z);
          if (x &gt; z)
              System.out.print("In order " + y + " " + z + " " + x);
      }
  
  
    }
  }
  </code></pre>