Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Unix%20Interview%20Questions%20and%20Answers

Question: Predict the output of the following program code
main()
{
fork(); fork(); fork();
printf("Hello World!");
}

Answer: "Hello World" will be printed 8 times.
Explanation:
2^n times where n is the number of calls to fork()
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook