What is output of the following program? [code] int main() { fork(); fork(); fork(); if (wait(0) == -1)

KellyPoima

New member
What is output of the following program?
Code:
 int main() 
 {     
	fork();       
	fork();        
	fork();       
	if (wait(0) == -1)          
	printf("leaf child\n");  
 }
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
 

Tìm kiếm

Back
Top