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.
Input:
Output: parent process Id:146