1,183 views

4 Answers

1 votes
1 votes

The output depends on the order in which the parent or child process gets executed which varies each time the code gets executed what no of process created remains same.

 

0 votes
0 votes
No matter in what order parent and child process executes you will get only one combination “abbabb”.
0 votes
0 votes
3 distinct output possible.

aabbbb

ababbb

abbabb

 

Output like abbbab not possible

Related questions

79
views
1 answers
0 votes
vivek10010 asked 5 days ago
79 views
How many child processes will be created in the following code: main(){if(!fork()){ if(!fork()) fork();}fork();}
434
views
1 answers
2 votes
Sparkboy asked Apr 4
434 views
Consider the following pieces of codes for fork( ) system call. Solve and explain how many child processes are created upon execution of this program? Snippet 1: ... 0; }Learning Outcomes. Understand the working of fork ( ) system call.
865
views
1 answers
0 votes
Erwin Smith asked Apr 11, 2023
865 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 possible?2,4,1,701,7041,2,4,704,7012,704,4,701,11,704,2,4,701
878
views
0 answers
1 votes
Souvik33 asked Nov 28, 2022
878 views
MSQ Consider the following statements, which one of the following is/are TRUEIn fork() system call, child process inherits all the open file descriptors of ... of the parent process User level threads shares the code segment of the process