All pastes #44905 Raw Edit

Casanova

public text v1 · immutable
#44905 ·published 2006-03-08 17:30 UTC
rendered paste body
#include <stdio.h>
#include <sys/types.h>
#include <inttypes.h>
int i=0;
int main()
{

     printf ("%d\n",i);
     if (fork() == 0) {
          i=10;
          printf ("Child...%d\n",i);
     }
     else {
          sleep (1);
          printf ("parent...%d\n",i);
     }
     return 0;
}


OUTPUT:
prash@einstein:~/college/Networks/project$ ./a.out
0
Child...10
parent...0