1 votes 1 votes void main(){ fork(); fork(); printf("Hello"); } How many time print function will execute Operating System iiith-pgee operating-system fork-system-call + – Tesla! asked Apr 22, 2018 retagged May 7, 2021 by Shiva Sagar Rao Tesla! 821 views answer comment Share Follow See 1 comment See all 1 1 comment reply Akshay Koli 4 commented Apr 22, 2018 reply Follow Share 4 times hello would be printed. 1 votes 1 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes 4 times. abhishekmehta4u answered Apr 24, 2018 selected Feb 28, 2019 by Rishi yadav abhishekmehta4u comment Share Follow See all 0 reply Please log in or register to add a comment.
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. Soumya29 answered Apr 23, 2018 Soumya29 comment Share Follow See all 0 reply Please log in or register to add a comment.
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. Skan answered Apr 24, 2018 Skan comment Share Follow See all 0 reply Please log in or register to add a comment.