title: What is recursion really and explain the output of this program?
body: <p>I really can't understand this code. When a function calls itself what really happens? It is related to the concept of stack, I know, but still I can't solve these questions.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  fun(int);
  
  main()
  {
    int x=3;
    fun(x);
  }
  
  fun(int a) 
  {
    if(a&lt;0)
     {
       fun(--a);    // what happens when function calls itself
       printf("%d",a);
       fun(--a);
     }
  } 
  </code></pre>
  
  <p>Please explain the sequence of events which occur during this.</p>