title: Printing a recursive function returned value when the function contains printf
body: <pre><code>#include &lt;stdio.h&gt;
  
  int c=0;
  
  int check (int c)
  {
      c=c+1;
      if (c&lt;6)
          return check(c);
      printf("%d\n", c);
  }
  
  int main()
  {
      printf("%d\n",check(c));
  }
  </code></pre>
  
  <p>The above code gives me </p>
  
  <pre><code>6
  2
  </code></pre>
  
  <p>as the output. 6 is from the printf function inside the check function but I did'nt get why 2. If I remove the printf function inside the check function I get</p>
  
  <pre><code>5
  </code></pre>
  
  <p>as the output. Can anyone explain why this happens?</p>