answered by sunny. and output you mentioned is also wrong. search archives.

On Tue, Jan 17, 2012 at 5:31 PM, shady <[email protected]> wrote:

>
>
> On Tue, Jan 17, 2012 at 4:54 PM, Durgesh Kumar <[email protected]>wrote:
>
>> #include<stdio.h>
>>
>> int main()
>> {
>>        int i=0;
>>         printf("hello world \n");
>>        i++;
>>        fork();
>>        printf("forking %d",i);
>>        i++;
>>
>> }
>> o/p :-
>> hello world
>>
>> Can any1 explain this??
>>
>> On 1/17/12, Durgesh Kumar <[email protected]> wrote:
>> > How can we join after the forking ????
>> >
>> > On 1/17/12, Durgesh Kumar <[email protected]> wrote:
>> >> #include<stdio.h>
>> >>
>> >> int main()
>> >> {
>> >>      int i=0;
>> >>         printf("helllo world %d\n",i);
>> >>         i++;
>> >>         fork(); //Fork Exeution Starts from here .
>> >>         printf("hello forking %d\n",i);
>> >>      i++;
>> >>
>> >> }
>> >>
>> >> o/p:-
>> >> helllo world 0
>> >> hello forking 1
>> >> hello forking 1
>> >>
>> >>
>> >>
>> >>
>> >> On 1/17/12, himanshu kansal <[email protected]> wrote:
>> >>> #include<stdio.h>
>> >>> int main()
>> >>> {             printf("hello");
>> >>>                fork();
>> >>>               printf("world");
>> >>> }
>> >>>
>> >>>
>> >>> what will be the o/p....
>> >>>
>> >>> on my system...its showing hello world hello world...
>> >>>
>> >>> but i think it could be hello world two times in any order.....
>> >>>
>> >>> please tell me what is the exact o/p...
>> >>>
>> >>> i have a little confusion also that whether child process starts
>> >>> executing from start of the main() or whether it starts from the line
>> >>> following the fork() command.....
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> "Algorithm Geeks" group.
>> >>> To post to this group, send email to [email protected].
>> >>> To unsubscribe from this group, send email to
>> >>> [email protected].
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/group/algogeeks?hl=en.
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >> *Durgesh Kumar*
>> >> Final Year, B.tech
>> >> Information Technology
>> >> HALDIA INSTITUTE OF TCHNOLOGY
>> >> HALDIA
>> >>
>> >
>> >
>> > --
>> > *Durgesh Kumar*
>> > Final Year, B.tech
>> > Information Technology
>> > HALDIA INSTITUTE OF TCHNOLOGY
>> > HALDIA
>> >
>>
>>
>> --
>> *Durgesh Kumar*
>> Final Year, B.tech
>> Information Technology
>> HALDIA INSTITUTE OF TCHNOLOGY
>> HALDIA
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to