166k views
0 votes
What is the number of processes created when the following program executes. int main() { fork(); fork(); fork(); return 0; }

User Sungmin
by
5.8k points

1 Answer

1 vote

Answer:


Process = 8

Step-by-step explanation:

Given

The code snippet

Required

Determine the number of processes

The number of process is calculated as thus:


Process = 2^n

Where n = 3

i.e. number of times fork() is called


Process = 2^n becomes


Process = 2^3


Process = 8

User Boey
by
5.4k points