610 views
1 votes
1 votes

 

2 Answers

1 votes
1 votes
both A and B are correct because the order of child and parent is not known.
0 votes
0 votes
Answer Will be 2, the order in which CPU execute either parent or child is nondeterministic.

Related questions

2 votes
2 votes
3 answers
2
Philosophical_Virus asked Dec 10, 2023
910 views
Int main (){fork();printf("a");fork();printf("b");return 0;}How many distinct outputs are possible of above code? And also give outputs
0 votes
0 votes
1 answer
3
Erwin Smith asked Apr 11, 2023
786 views
void main() { int n = 1; if(fork()==0) { n = n<<1; printf(“%d, “, n); n = n <<1; } if(fork()==0) n=n+700; printf(“%d, “,n); }Which of the following output is not ...