Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 07-06-2010, 02:06 PM   #1
LQ Newbie
Registered: Jul 2010
Posts: 18

Rep: Reputation: 0
Guess output of this program?

Guess Output


int pid;
printf("Hello Child process");
printf("Hello Parent Process");

But your guess might be wrong.......

see the output what i am getting .
HelloHello Parent ProcessHelloHello Parent Process

can you explain why? i really confused

Last edited by vivignesh; 07-06-2010 at 02:19 PM.
Old 07-06-2010, 02:12 PM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735
Please do not use texting shorthand here: you, your

Do you have the correct syntax and use of brackets for the "if" construct? Please put your code into [CODE] tags so we can see the formatting. (Go to advanced edit mode, select the code, and click the "#")
Old 07-06-2010, 02:27 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,047
Blog Entries: 11

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

fork, program

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Output of the C program? thelink123 Programming 8 06-10-2009 12:08 AM
How to pass the output of one program to another program without backticks? BrianK Linux - General 4 11-11-2008 07:27 PM
I Have A Game For You Guess That Program!!!! op_stager General 15 09-28-2004 01:50 AM
C function to execute a program and return the output of the program ryan.n Programming 4 08-14-2004 11:11 PM
How do I save the output from a program? Fe98 Programming 4 11-10-2003 10:18 AM

All times are GMT -5. The time now is 06:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration