Consider the following C program:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main (void)
{
pid_t pid;
int x = 2;
pid = fork ( );
if (pid = = 0);
x = 8;
fork( );
printf("%d", x);
return 0;
}
Fork ( ) is a system call creates new child process on successful execution. Assuming all invocations of fork are successful, which of the following is a correct output when the program is executed on the unix OS?[MSQ]
(a) 8 2 2 8 (b) 8 8 2 2 (c) 2 8 8 2 (d) 2 2 8 8