Anonymous user menu

Fork System call

Consider the following piece of code
main()
{
int i,n;
for(i=1;i<=n;++i)
   fork();
}
How many times child process will created?

Answer

For n=1, 1 child process.
For n=2, 3 child processes.
..............................
For n, total 2n-1 child process will be created.

0Comment