* void main() { int p1= fork();
if (p1 == 0) { int p2 = fork(); if (p2 != 0) { fork(); } } } for confirmation just make a diagram M / \ / \ M C1 --------> fork() 1st M>0 and C1==0 / \ / \ / \ C1 C2 ----------> fork() 2nd C1>0 and C2==0 / \ C1 C3 -----------> fork() 3rd * On Tue, Aug 9, 2011 at 12:04 AM, aditi garg <aditi.garg.6...@gmail.com>wrote: > well since i have told u i dont knw OS too well so i ws nt sure...bt if > suppose the condition (p1==0) is false thn only 1 child will be created?? > > > On Mon, Aug 8, 2011 at 11:56 PM, ankit sambyal <ankitsamb...@gmail.com>wrote: > >> @aditi : the ans is 3. Why do u think there is no definite ans ? >> >> -- >> 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. >> > > > > -- > Aditi Garg > Undergraduate Student > Electronics & Communication Divison > NETAJI SUBHAS INSTITUTE OF TECHNOLOGY > Sector 3, Dwarka > New 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. > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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.