How can you obtain the process ID and parent process ID of a running process in a C program? Provide code examples using `getpid()` and `getppid()` functions.
The process id of the running process can be obtained by using getpid() and that of its parent can be obtained by getppid() function. Here's the coding example:-