#include
#include
int main()
{
fork();
fork() && fork() || fork();
fork();
printf
fork();
fork system call returns an integer: the PID of the process in the parent process and 0 in the child process. If an error occurs, no process is created and -1 is returned.
|| and && are logical operators.
If the result of the operator is know after the evaluation of their left operand, they are required to short-circuit (i.e., not evaluate the right operand):
|| operator its right operand is not evaluated if its left operand is != 0&& operator its right operand is not evaluated if its leftt operand is == 0