title: forks and its functionality?
body: <p>I have the following code and am asked to how many times "A", "B", "C", "D", "E" will be printed</p>
  
  <pre><code>fun() {
    printf("A");
    fork();
    printf("B");
    if (fork() != 0) {
       printf("C");
       fork();
       printf("D");
    }
    printf("E");
  }
  </code></pre>
  
  <p>so it should be:</p>
  
  <pre><code>A
  A 
  B
  E
  </code></pre>
  
  <p>im not sure if my answer above is correct? and what the line <code>if(fork() !=0 )</code> do?</p>