fork download
  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. int main()
  5. {
  6. int a=5;
  7. if (fork() == 0)
  8. {
  9. a = a + 5;
  10. printf("%d, %d \n", a, &a);
  11. }
  12. else
  13. {
  14. a = a - 5;
  15. printf ("%d, %d \n", a,& a);
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
0, -1953416140 
10, -1953416140