title: consider the `fork` program given, how many times does the following program print hello?
body: <blockquote>
    <p>Please, consider the <code>fork</code> program given  below:</p>
  </blockquote>
  
  <p>How many times does the following program print hello?</p>
  
  <pre><code>main(int argc, char **argv) {
   int i;
   for (i=0; i &lt; 3; i++) {
   fork();
   printf("hello\n");
   }
  }
  </code></pre>
  
  <p>Total “hello” messages = 2 + 4 + 8 = 14 (<a href="https://www.cs.rutgers.edu/~pxk/416/exam/old/exam1-review-2014-s.pdf" rel="nofollow noreferrer">see question-1 at page-5</a>).</p>
  
  <hr>
  
  <p>How many times does the following program print hello?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  main()
  {
  int i;
  for (i=0; i&lt;3; i++)
  fork();
  printf("hello\n");
  }
  </code></pre>
  
  <p>Total “hello” messages = 8 (<a href="https://www.cs.rutgers.edu/~pxk/416/exam/old/exam1-review-2011-s.pdf" rel="nofollow noreferrer">see question-4 at page-5</a>).</p>
  
  <p>It seems to me both program are same. Why are explanation/answer is different?</p>
  
  <blockquote>
    <p>Can you explain, please? </p>
  </blockquote>