Simple piece of code:
#include <stdio.h>
#include <string.h>
main()
{
printf("Process");
fork();
fork();
return 0;
}
From my understanding of fork(), after this code executes we will have 3 child processes and 1 parent process. Also whenever we call fork() the execution should start from the statement immediately after the fork() statement. Hence according to me "Process" should be printed only once. But in my output Process is being printed 4 times. How is that possible?