
/* include header files */

#include <stdio.h>       // printf
#include <unistd.h>      // fork
#include <sys/types.h>   // fork

/* main function */

int main(){              // no arguments needed
  
  int child_pid;
  
  child_pid=fork();      // execute fork function and remember result
  
  if (child_pid == 0) {  // compare result with 0
    
    /* child section */
    
    printf("Child: I'm fine\n");
  }
  else {
    
    /* parent section */
    
    printf("Parent: How are you?\n");
  } 
  
  printf("This line is displayed twice\n"); 

  return 0;
}

