title: Finding absolute value with if statement
body: <p>I have 2 int variables which the user needs to enter, and I need to find the absolute value of their difference, is there a way to do it on the same principle I have started in this code?</p>
  
  <pre><code>    Scanner scn = new Scanner(System.in);
  
      int yourfloor, elefloor, desfloor;`enter code here`
      System.out.println("Please enter your current floor");
      yourfloor = scn.nextInt();
      System.out.println("Please enter the elevator current floor(before inviting)");
      elefloor = scn.nextInt();
      System.out.println("Please enter your destination floor");
      desfloor = scn.nextInt();
  
      int getTime = yourfloor - elefloor;
      if (getTime&lt;0);
      {getTime*(-1)};
  </code></pre>