#include <stdio.h>
#include <unistd.h>

int main()    {
   pid_t  pid;
   printf("Let's distinguish parent and child!\n");
   pid=fork();
   switch(pid)   {
      case -1: perror("fork");
               break;
      case  0: printf("This is child process, pid=%d, ppid=%d!\n",  getpid(),  getppid());
               break;
      default: sleep(1);
			   printf("This is parent process, pid=%d!\n",getpid());
               break;
   }
   return (0);
}
