Examveda
Examveda

What is output of the following program?
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

Answer: Option C


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux