Infinite times
Yanan Cao


On Mon, Aug 22, 2011 at 2:43 PM, Don <dondod...@gmail.com> wrote:

> // 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to