The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
34 views
Including the initial parent process, how many processes are created by the program shown below-

#include <stdio.h>
#include <unistd.h>
int main()
{
int i;
for (i = 0; i < 4; i++)
fork();
return 0;
}
in Operating System by Boss (41.4k points) | 34 views

1 Answer

0 votes

Total number of child process are created = $2^n$-1.

Here for loop executed 4 times( n=4) .

Total number of child process are created = $2^4$ -1 =16-1 = 15.

 

by Boss (34.6k points)
edited by

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,092 questions
55,292 answers
190,811 comments
86,116 users