Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<sys/wait.h>
  3. int main(){
  4. int pid;
  5. pid=fork();
  6. if(pid==0){
  7. printf("nI am the child and my parent id is - %d and mine id %dn",getppid(),getpid());
  8. }
  9. else
  10. printf("nI am the parent and my pid is %d and my parent id is %dn",getpid(),getppid());
  11. return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement