title: Return in Recursion and basic flow
body: <p>I am not able to understand the flow of program in recursion with and without return both.How do i return or print the group of values calculated by the function?For eg To calculate all the peak elements in an array I used recursion but I am not able to get how to give those values as a result.Basically I am not clear what happens if i write or not write return before the recursive function.</p>
  
  <pre><code>int  peak(int arr[],int i,int size)
  {
      while(i&lt;size)    
      {
          if(arr[i]&gt;arr[i+1]&amp;&amp;arr[i]&gt;arr[i-1])
              cout&lt;&lt;arr[i];
          i++;
          return peak(arr,i,size);
      }
  }
  </code></pre>