Vidyalelo
Computer Science · Q509

Linux

Engineering and GATE · Computer Science · question 509

Q509

What is output of the following program? int main() fork(); fork(); fork(); if (wait(0) == -1) printf("leaf child ");

A.
"leaf child" will be printed 1 times
B.
"leaf child" will be printed 3 times
C.
"leaf child" will be printed 4 times
Answer
D.
"leaf child" will be printed 8 times

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board