title: Finding the highest difference of pairs recursive in C / C++
body: <p>I am trying to write recursive code of the highest pair difference, for example: I have this code, but I don't want save my answer to array, and I need my recursive code only with two operators array and the size of array:</p>
  
  <pre><code>int theBigNum(int arr[], int i){
      int tmpSum,sum = 0;
      tmpSum = arr[i] - arr[i-1];
      if (tmpSum &lt; 0)
          tmpSum = tmpSum * -1;
      if (tmpSum &gt; arr[6])
          arr[6] = tmpSum;
      if (i &lt; 2)
          return arr[6];
      return  theBigNum(arr, i - 1);
  }
  
  
  void main() {
  
      int arr[7] = { 4, 6, -2, 10, 3, 1, 2};
      int num  = theBigNum(arr, 6);
  
  }
  </code></pre>
  
  <p>the return answer must be 12, because it is the highest close pair difference .
  Help, me!
  Thank You!</p>