Advertisement
redsees

Untitled

Apr 22nd, 2014
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include<sys/types.h>
  2. #include<stdio.h>
  3. #include<unistd.h>
  4. int main(void){
  5. pid_t x,y;
  6.  
  7. fork();
  8. printf("A-Process ID : %d\n",getpid());
  9. printf("B-Process ID : %d\n",getpid());
  10. fork();
  11. printf("C-Process ID : %d\n",getpid());
  12. printf("D-Process ID : %d\n\n",getpid());
  13. sleep(50);
  14. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement