title: Recursion and static variables
body: <p>So I was preparing for an entrance exam here in India when I came across this piece of C code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(void) {
      static int i = 4;
      if (--i) {
          main();
          printf("%d", i);
      }
  }
  </code></pre>
  
  <p>I thought the <code>printf</code> statement never gets executed and the output will be blank.
  But I saw the answer to be <code>0000</code> and that this happens due to the <code>static</code> keyword with the <code>int</code>.</p>
  
  <p>Can anyone explain why the printf executes or is that guy wrong?</p>