title: How to find the difference of two numbers and the absolute value of that answer without using math.abs function JAVA
body: <p>How can I find the absolute value of the difference of two numbers. (BEGINNER)</p>
  
  <p>i.e. My program will compute |a-b| (in that order), WITHOUT using math.abs. </p>
  
  <p><strong>This is what I have so far:</strong></p>
  
  <pre><code>public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      double a = in.nextDouble();
      double b = in.nextDouble();
      double value = a - b;
  
      System.out.println("Enter a: ");
      a = in.nextDouble();
  
      System.out.println("Enter b: ");
      b = in.nextDouble();
  
      //If value is negative...make it a positive number.
      value = (value &lt; 0) ? -value : value;
  
      System.out.println(a + "-" + b + "=" + (a - b));
      System.out.println(b + "-" + a + "=" + (b - a));
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>PLEASE HELP, I AM A BEGINNER!</p>