A new process cam be created using the system call called fork()
in order to use the fork command use the header called <unistd>,<sys/types.h>
when fork is executed new process is created which is called as the child process while the process which created the child process is called the parent process
int main( )
printf ( "Before Forking\n" ) ;
fork( ) ;
printf ( "After Forking\n" ) ;
fork() creates a child process and duplicates the code of the parent process in the child process.there on wards the execution of the fork() function continues in both the processes.Thus ,the duplication code inside fork() is executed once.whereas, the remaining code inside it is executed in both the parent as well as the chold process.As against this, when control returns from fork() of the child process,it always returns a 0.