title: calculating the sum between two integers (java)
body: <p>What did I do wrong? I'm really not sure what else to try or where my mistake is. Thanks for any help. It's supposed to calculate the sum of integers between two numbers, e.g. between <strong>3</strong> and <strong>6</strong> it would be <strong>3</strong> + 4 + 5 + <strong>6</strong> </p>
  
  <pre><code>import java.util.Scanner;
  public class TheSumBetweenTwoNumbers {
      public static void main(String[] args) {
          Scanner reader = new Scanner(System.in);
  
          System.out.println("First:");
          int n = Integer.parseInt(reader.nextLine());
  
          System.out.println("Second:");
          int max = Integer.parseInt(reader.nextLine());
  
          int sum = 0;
          int i = 0;
          int difference  = max - n;
  
          while (i &lt; difference) {
              sum = n + (n + 1);
              n++;
              i++;
  
          }
  
          System.out.println("Sum is " + sum);            
      }
  }
  </code></pre>