Operating Systems Lab Manual / Use of Fork in Operating System C Program

Program Name: Write a C Program to demonstrate use of fork in operating system.
Theory
Fork is a system call used to create two processes. One parent process with process id non zero and 
one child process with process id zero.

Getpid : returns process ID of the calling process Getppid() : returns the process ID of the parent of the calling process.
Program Code


Input:

Output:
parent process Id:146


Home     Back