title: How to find out the odd integers in an array using a recursive method?
body: <p>I am trying to write a method that finds how many odd numbers are between first position and last position. The method accepts an array, and then two <code>int</code>s for the low and high position. This method needs to be made recursively. Here is what I have so far. Here is the method call and the int array. I'm getting an output of 1 but the answer should be 2.</p>
  
  <pre><code>int array [] = {5, 2, 5, 6, 3, 1};
  int n = countOddsInRange(array, 1, 4)
  
  public static int countOddsInRange(int [] a, int first, int last)
  {
      int count = 0;
      if(first &lt;= last)
      {
          countOddsInRange(a, a[first + 1], a[last]);
          if(a[first] % 2 == 0)
          {
              count++;
          }
      }
      return count;   
  }
  </code></pre>