title: What is the difference between fork() with else and without else
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  
  int main(){
      if(fork()&gt;0){
          printf(&quot;i am p\n&quot;);
          fork();
      }    
      else{
          printf(&quot;i am c\n&quot;);
      }
  }
  </code></pre>
  <p>the output is</p>
  <pre><code>i am p
  i am c
  </code></pre>
  <p>without else the output is</p>
  <pre><code>i am p
  i am c
  i am c
  i am c
  </code></pre>
  <p>I can't understand the second fork do when with else and without else.</p>