Logo 
Search:

C Programming Articles

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

Program to find process id and parent process id

Posted By: Adelmo Fischer     Category: C Programming     Views: 4259

Write a Program to find process id and parent process id.

Code for Program to find process id and parent process id in C Programming

#include<stdio.h>

main()
{
    
    printf("hello process is %d of parent :%d\n",getpid(),getppid());
    fork();
    printf("child : %d of parent %d \n",getpid(),getppid());
    fork();
    printf("child : %d of parent: %d\n",getpid(),getppid());

}
    
  
Share: 


Didn't find what you were looking for? Find more on Program to find process id and parent process id Or get search suggestion and latest updates.

Adelmo Fischer
Adelmo Fischer author of Program to find process id and parent process id is from Frankfurt, Germany.
 
View All Articles

 
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!