Advertisement
redsees

Untitled

Apr 22nd, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 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. x=fork();
  8. printf("A-Process ID : %d\n",getpid());
  9. }
  10. printf("B-Process ID : %d\n",getpid());
  11. {
  12. y=fork();
  13. printf("C-Process ID : %d\n",getpid());
  14. }
  15. printf("D-Process ID : %d\n\n",getpid());
  16. sleep(50);
  17. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement