#include<stdio.h>
main()
{
printf("hello process is %d of parent :%d\n",getpid(),getppid());
fork();
printf("child : %d of parent %d \n",getpid(),getppid());
fork();
printf("child : %d of parent: %d\n",getpid(),getppid());
}
OUTPUT
************
[04MCA58@LINTEL 04MCA58]$ cc 2nproc.c
[04mca58@LINTEL 04mca58]$ ./a.out
hello process is 1488 of parent :616
child : 1488 of parent 616
child : 1489 of parent 1488
child : 1489 of parent: 1488
child : 1488 of parent: 616
child : 1491 of parent: 1488
child : 1490 of parent: 1489