main()
{
if (fork() || (fork() && fork()))
printf("AA\n");
else if (!fork())
printf("BB\n");
else
printf("CC\n");
}
I have run the following code and get the results AA AA CC BB CC BB. While I understand how fork works, I don't understand what it does with logical operators. The teacher in our class wants us to give the answers for this homework. While I can easily run this program, I would like to know what happens exactly. Can anyone explain or direct me to a website to what happens when using fork with logical operators.
I am pretty new to c/c++ so go easy on me. Thanks