What is the default sleep time if we don't pass any arguments to sleep( ) function?
#include<stdio.h>
int main()
{
int pid,dip,cpid;
pid = fork();
if (pid == 0)
{
printf("\n first child is created %d",getpid());
}
else
{
dip = fork();
if (dip == 0)
{
printf("\n second process is creatred %d",getpid());
}
else
{
sleep();
cpid = wait(0);
printf("\n child with pid %d ", cpid);
cpid = wait(0);
printf("\n child with pid %d ",cpid);
printf("\n I am parent \n");
}
}
}
What is the output of the above code?