A process executes the code fork(); fork(); fork(); the total number of child…
20122025
A process executes the code
fork();
fork();
fork();
the total number of child processes created is
Answer: C. 7 — Key idea: Each call to fork() doubles the number of processes. Start with 1 process (the original parent). After three fork() calls, total processes = 2^3 =…
- A.
3
- B.
4
- C.
7
- D.
8
Attempted by 828 students.
Show answer & explanation
Correct answer: C
Key idea: Each call to fork() doubles the number of processes.
Start with 1 process (the original parent).
After three fork() calls, total processes = 2^3 = 8.
Child processes = total processes − original parent = 8 − 1 = 7.
A video solution is available for this question — log in and enroll to watch it.
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…