C Programming Blog

 
 
 
#include<stdio.h>

main()
{
    int id;
    id=fork();

    if(id>0)
    {
        printf(\"Parent will sleep\");
        sleep(10);
    }
    if(id==0)
        printf(\"I am child\");
}

OUTPUT
***********

[04mca58@LINTEL 04mca58]$  cc zombie.c
[04mca58@LINTEL 04mca58]$  ./a.out
I am child
Parent will sleep
[04mca58@LINTEL 04mca58]$ 

 
 
Didn't find what you were looking for? Find more on PROGRAM FOR ZOMBIE PROCESS