title: Running fork and printing hello
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3513242/working-of-fork-in-linux-gcc">Working of fork() in linux gcc</a><br>
    <a href="https://stackoverflow.com/questions/9581787/why-does-this-code-print-two-times">Why does this code print two times?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>#include&lt;stdio.h&gt;
  main()
  {
  
   printf("hello\n");
   fork();
  
  }
  </code></pre>
  
  <p>The above code prints "hello" one time.The code below prints "hello" two times.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  main()
  {
  
   printf("hello");
   fork();
  
  }
  </code></pre>
  
  <p>The code above prints "hello" two times.</p>
  
  <p>Please Somebody explain this strange behavior.</p>