Consider the following C code segment:
#include <unistd.h>
#include <stdio.h>
int main() {
int i;
for (i = 0; i < 2; i++) {
pid_t pid = fork();
if (pid == 0) {
// Child branch
printf("Child %d created in iteration %d\n", getpid(), i);
break; // Exit the loop only for the child process
} else {
// Parent branch
printf("Parent %d created child %d in iteration %d\n", getpid(), pid, i);
}
}
sleep(1);
return 0;
}
Assuming all $\verb|fork()|$ calls succeed, what is the total number of processes (including the original parent) that will be running immediately before the program terminates?