i know that the program sholud have printed "hello word" 8 times....bt whn i run it, i get diffrnt reslts everytime and on diffrnt compilers....... please tell the reason....
On Thu, May 24, 2012 at 11:11 AM, rajesh singarapu <rajesh0...@gmail.com>wrote: > 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. > > -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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.