main process have completed till the time all processes processes prints Hello World,
to prevent it, use wait/wait4 family of fucntions. ~r On Thu, May 24, 2012 at 8:26 AM, Rajesh Kumar <testalgori...@gmail.com> wrote: > #include<stdio.h> > main() > { > fork(); > fork(); > fork(); > printf("Hello Word\n"); > } > > output --- > rajeshkumar@rajeshkumar-laptop:~$ ./a.out > Hello Word > Hello Word > Hello Word > rajeshkumar@rajeshkumarr-laptop:~$ Hello Word > Hello Word > Hello Word > Hello Word > Hello Word > > > Why it is not printed continously? > > > -- > 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.