Help needed

Please tell me what the possible output is for this program.
Please show the resulting process tree.

int main()
{
pid_t pid;
fork();
cout<<‘1’;
pid=fork();
if(pid>0)
{
fork();
cout<<‘2’;
}
cout<<‘3’;
return 0;
}

1 Like