When Process executed fork(). It create the Same Structure as the main
process.The only difference is the return value of the child fork process is
0 and that of parent is the PID of its Child process.
 Now you can draw the pictorial representation of the fork processes during
the execution and its corresponding values.

On Mon, Aug 8, 2011 at 12:49 PM, Kamakshii Aggarwal
<kamakshi...@gmail.com>wrote:

> then please elaborate?
>
>
> On Mon, Aug 8, 2011 at 12:34 PM, Pradex <pradam.prad...@gmail.com> wrote:
>
>> get it..!! :) :)
>>
>> On Aug 7, 10:49 pm, Shachindra A C <sachindr...@gmail.com> wrote:
>> > 8 one's and 8 two's. The order in which they get printed might vary.
>> >
>> > On Mon, Aug 8, 2011 at 11:11 AM, Kamakshii Aggarwal
>> > <kamakshi...@gmail.com>wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > what will be the o/p of the following program:
>> >
>> > > main()
>> > > {
>> > > int ret;
>> > > ret=fork();
>> > > ret=fork();
>> > > ret=fork();
>> > > ret=fork();
>> >
>> > > if(!ret)
>> > > printf("one");
>> > > else
>> > > printf("two");
>> > > }
>> >
>> > > --
>> > > Regards,
>> > > Kamakshi
>> > > kamakshi...@gmail.com
>> >
>> > > --
>> > > 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,
>> > Shachindra A C
>>
>> --
>> 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,
> Kamakshi
> kamakshi...@gmail.com
>
>  --
> 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