2 votes 2 votes closed as a duplicate of: fork system call int main(void) { if(fork() && fork()) { fork(); } if(fork() || fork()) { fork(); fork(); } printf("\nGate 2017\n"); } How many times "Gate 2017" will be printed? Operating System operating-system fork-system-call + – dd asked Oct 24, 2016 • closed Oct 24, 2016 by vijaycs dd 1.3k views comment Share Follow See all 6 Comments See all 6 6 Comments reply dd commented Oct 24, 2016 reply Follow Share answer was given as 24. I think it is wrong 0 votes 0 votes Habibkhan commented Oct 24, 2016 reply Follow Share It is coming to be 45.. Plz let me know if it is correct or not.. 0 votes 0 votes dd commented Oct 24, 2016 reply Follow Share I don't know the answer and ran the program, it is printing 33 /31/34 times (variable) 0 votes 0 votes Habibkhan commented Oct 24, 2016 reply Follow Share I did without the concept of shortcircuiting within the conditions.So answer will vary I suppose since by default short circuiting is allowed .Let me check once more.. 0 votes 0 votes Prabhanjan_1 commented Oct 24, 2016 reply Follow Share https://gateoverflow.in/69830/os 0 votes 0 votes ADITYARAJ commented Mar 5 reply Follow Share Ans: 36 Times Gate 2017 printed 0 votes 0 votes Please log in or register to add a comment.