#include int main() { int childPID; int i; for (i=0; i< 2; i++) { childPID = fork(); if (childPID == 0) { printf("Hello from the child process %d\n", getpid()); } else { printf("Hello from the parent process, child process PID is %d\n", childPID); } } return 0; } /* gcc -o fork1 fork1.c ./fork1 Hello from the parent process, child process PID is 18974 Hello from the parent process, child process PID is 18975 Hello from the child process 18974 Hello from the child process 18976 /MPI/Fork$ Hello from the child process 18975 Hello from the parent process, child process PID is 18976 */