Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Parallel Processing ProgramsRSS Feeds

Program to create two child processes and examine the output

Posted By: Ramon Fischer     Category: C Programming     Views: 4068

Write a C Program to create two child processes and examine the output.

Code for Program to create two child processes and examine the output in C Programming

int main()
{
        printf("hello \n");
        fork();
 
        printf("Hi after 1st fork \n");
        fork();
 
        printf("hello hi after 2nd fork \n");
 
}


Output:

[04mca8@LINTEL 04mca8]$ ./a.out
hello
Hi after 1st fork
hello hi after 2nd fork
hello hi after 2nd fork
Hi after 1st fork
hello hi after 2nd fork
hello hi after 2nd fork


  
Share: 



Ramon Fischer
Ramon Fischer author of Program to create two child processes and examine the output is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!