About fork method


#1

main()
{
int t1,t2,t3;
t1=t2=t3=0;
t1=fork();
t2=fork();
if (t1!=0){t3=fork();
printf(“Hello”);}
}
output:
How many Hello’s are printed when above code get executed.

A. 1

B. 2

C. 3

D. 4


#2

4 Hello will be printed. So the answer is option D