/* Realize a program that receives from command line two integer numbers, n_levels and n_children. The program (father process) must create a number of children equal to n_children and terminate. In turn, every child must generate n_children children and terminate. This process must be repeated n_levels times (in that moment (n_children)^(n_levels) leaves processes are in execution. Such processes (the "leaves" processes) must wait 1 second, and then print (into the screen) a termination message. */ #include #include #include int main(int argc, char *argv[]) { pid_t pid; int i, j; int n_levels = atoi(argv[1]); int n_children = atoi(argv[2]); fprintf(stdout, "FIRST PROCESS: PID %d PPID: %d\n", getpid(), getppid()); for (i=0; i