I'm trying to figure out how many processes this program creates, including the initial parent process. The correct answer should be 9, but I don't understand why the answer is 9. How are these 9 processes created? Thanks in advance!
#include <stdio.h>
#include <unistd.h>
…
int main()
{
pid_t john;
john = fork( );
if (john == 0) {
fork( ); fork( ); fork( );
}
/* Consume resources of another process */
/* This does NOT create a new process. */
Consume( ); Consume( );
return 0;
}