Allow Parent Procees To Execute Its Instructions After All Children Have Exited.

C program to allow parent procees to execute its instructions after all children have exited. Source Code: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void main() { int pid,status; pid=fork(); if(pid==0) { printf("\nHello I'm child.."); sleep(2); } else { wait(&status); printf("\nThis is Parent after waiting for child..."); exit(0); } }

Share:

0 comments