Algorithms Quiz | SP Contest 3 | Question 7
Consider the below C program:
int main()
{
fork();
fork();
fork();
printf ( "Hello World" );
}
|
How many child processes will be created when the above program executes?
(A) 4
(B) 5
(C) 6
(D) 7
Answer: (D)
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.
Quiz of this Question
Last Updated :
25 Jul, 2018
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...