KellyPoima
New member
What is output of the following program?
a) "leaf child" will be printed 1 times
b) "leaf child" will be printed 3 times
c) "leaf child" will be printed 4 times
d) "leaf child" will be printed 8 times
Code:
int main()
{
fork();
fork();
fork();
if (wait(0) == -1)
printf("leaf child\n");
}
b) "leaf child" will be printed 3 times
c) "leaf child" will be printed 4 times
d) "leaf child" will be printed 8 times