Question: (10 points) Consider the following code segments, and answer the question. int main() { intent - 1; if(fork() != 0) { wait (NULL); if (fork()

 (10 points) Consider the following code segments, and answer the question.

(10 points) Consider the following code segments, and answer the question. int main() { intent - 1; if(fork() != 0) { wait (NULL); if (fork() == 0) { printf("C"); } else { cnt -= 1; } if (cnt == 0) printf("D"); else printf("E"); fflush(stdout); exit(0); ) else{ if(fork() != 0) { wait (NULL); printf("A"); 1 printf ("B"); fflush(stdout); exit(0); 1. (5 points) If the code at A and B locations in the program is empty, list all possible output. 2. (5 points) If the codes of positions A and B in the program are: A: printf("F"); fflush(stdout); B: exit(0); list all possible output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!