Linux C

#include
#include
#include
int main(void) {
pid_t pid;
pid = fork();
if(pid == 0) {
printf("I am child with pid: %d\n", getpid());
printf("as a child my parent pid is: %d\n", getppid());
} else {
printf("I am a parent with pid: %d\n", getpid());
printf("as a parent my child pid is: %d\n", pid);
}
/* Following code executes in both processes */
printf("oew.. I have to exit: %d\n", getpid());
exit(0);
}