// DO NOT RUN THIS! By inspection, how many times will it print "Hello
world"?
// If you find out by running it, that is cheating. Don't do it!
int main()
{
int i=0, j=0;
for(i = 0; i*j < 20; ++i)
{
if (fork() > 0) ++j;
else i = j = 0;
printf("Hello world\n");
}
return 0;
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.