void forkexample() { // child process because return value zero if (fork() == 0) printf("Hello from Child!\n"); // parent process because return value non-zero. else printf("Hello from Parent!\n"); } int main() { forkexample(); return 0; }
Please someone explain how things are working?
check the links which is provided in the answer https://gateoverflow.in/242749/self-doubt