Consider the below C program:
How many child processes will be created when the above program executes?
Explanation: For n fork calls in a program, (2n-1) child processes are created.
Here n = 3.
Therefore, no of child process = 23 – 1 = 8 – 1 = 7.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.