int main () { int i = 0; setbuf(stdout,0); while (i<=2 && fork()){ if (!fork()) { fprintf (stdout, "Running Exec ..."); execlp ("echo", "echo", "i*i", (char *) 0); } i++; fprintf (stdout, "Running System ..."); system ("echo i+i"); } return (0); } The process we will call Parent generates 6 children. 3 children terminate immediatelly for the condition of the while cycle (&&fork()). The others 3 make use of the system call exec() and print i*i (since the exec() substitutes the image of the calling process without returning, these children terminate just after the print of i*i) The Parent will continue its execution by printing i+i for three times. A possibile output of the command (excluding fprintf()) could be i+i i*i i+i i*i i+i i*i The printing order of the messages could be different and depends on their scheduling order, becuse Parent and children are concurrent.