Follow me on Linkedin

How many times “Hello World” is printed by following program? int main() { if(fork() && fork()) { fork(); } if(fork() || fork()) { fork(); } printf(“Hello world”); return 0; } a. 16 b. 20 c. 24 d. 64

How many times “Hello World” is printed by following program?
int main()
{
if(fork() && fork())
{
fork();
}
if(fork() || fork())
{
fork();
}

printf(“Hello world”);
return 0;
}

a. 16
b. 20
c. 24
d. 64


Solution : 24


a