title: Adding numbers within a certain range. How?
body: <p>So far I cant figure out how to do it. It only adds the start and the end of the range, it doesnt add the numbers within the range or I think its not what I input as a range that it adds but instead it adds the number between x an y.</p>
  
  <p>I am trying to add numbers between a certain range of array.</p>
  
  <pre><code>int[] range = new int[10];
  
  for (int x = 0; x &lt; range.length; x++) {
      System.out.print("Enter number: ");
      range[x]  = in.nextInt();
  }
  
  System.out.println("Enter the numbers for the start and end of the range. ");
  int start = in.nextInt();
  int end = in.nextInt();
  
  start = range[start];
  end = range[end];
  
  for(; start &lt; end; end = end -1) {
      start =end+ start;
  }
  
  System.out.println(start);
  </code></pre>
  
  <p>Sorry if the question has already been asked.</p>