#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
 int childpid;
 childpid = fork();
 if (childpid == -1) {
 printf("Can't fork.\n");
 exit(1);
 }
 else if (childpid == 0) {
 printf("\nChild: child pid = %d, parent pid = %d\n", getpid(), getppid());
 exit(0);
 }
 else {
 printf("\nParent: child pid = %d, parent pid = %d\n", childpid, getpid());
 printf("Hai\n");
 exit(0);
 }
}
