title: printing the reverse of an integer array using recursion in C
body: <p>I am not able to understand how I am getting a garbage value in output . Can someone explain me the flow . Thank you .</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void rev(int *ptr){
  
    if(*ptr) {
      rev(ptr+1);
      printf("%d\n",*ptr);
  
    }
  }
  
  int main(){      
  
    int arr[]={4,2,3,1,5};  
    rev(arr);  
    return 0;  
  }
  </code></pre>
  
  <p>output -</p>
  
  <pre><code>32764   
  5
  1
  3 
  2  
  4     
  </code></pre>