retagged by
821 views

3 Answers

3 votes
3 votes

Hello will be printed 2n times where n is the number of times fork() function called.
Here n=2
22 = 4.
Print function will get executed 4 times. 
 

0 votes
0 votes

Fork call makes a new process with copy of address space of parent process. Both parent and child continues execution with instructions after fork.

Fork calls diagram

Related questions

3 votes
3 votes
0 answers
1
Tesla! asked Apr 22, 2018
675 views
Which of the following system calls does not return control to the calling point, on termination?a) forkb) execc) ioctld) none of the option
1 votes
1 votes
0 answers
2
Akhilesh Singla asked Apr 14, 2018
1,712 views
I think options A, D and E are wrong; B is true. I'm not sure about C. I think it should be true because page table is created for a process and not for its threads so pa...
3 votes
3 votes
0 answers
3
Tesla! asked Apr 22, 2018
690 views
In a min-heap with $n$ elements with the smallest element at the root, the $7^{th}$ smallest element can be found in time$\Theta (n \log n)$$\Theta (n)$$\Theta(\log n)$$\...
2 votes
2 votes
0 answers
4