GATE 2012 CS (CS1) – Question 18
A process executes fork(); fork(); fork();. How many child processes are created?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) 7
Explanation
Every successful fork doubles the number of active processes, so three successive calls across all descendants produce 2³=8 total processes. Excluding the original parent leaves seven children, C. This assumes all forks succeed.