#include
#include
#include
int count;
main()
{
int i;
for(i=0;i<3;i++)
fork();
count++;
printf("Hello %d\n",count);
}
sandesh@nextfour:~/labs> gcc fork.c
sandesh@nextfour:~/labs> ./a.out
Hello 1
Hello 1
Hello 1
Hello 1
Hello 1
Hello 1
Hello 1
Hello 1
sandesh@nextfour:~/labs>
No comments:
Post a Comment