title: Code not printing parent process statements
body: <p>I am running the following code: </p>
  
  <pre><code>// A C program to demonstrate Zombie Process. 
  // Child becomes Zombie as parent is sleeping
  // when child process exits.
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;unistd.h&gt;
  int main()
  {
      // Fork returns process id
      // in parent process
      pid_t child_pid = fork();
  
      // Parent process 
      if (child_pid &gt; 0)
          {printf("in parent process");
          sleep(50);
          }
  
      // Child process
      else       
          {   printf("in child process");
              exit(0);
          }
  
      return 0;
  }
  </code></pre>
  
  <p>And get following output:</p>
  
  <pre><code>$main
  in child process
  </code></pre>
  
  <p>I am running the code here: <a href="http://tpcg.io/6ZccnX" rel="nofollow noreferrer">http://tpcg.io/6ZccnX</a></p>
  
  <p>Why is the statement "in parent process" not printing?</p>