Engineering Concepts
Wednesday, 6 August 2014
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()
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment