#include
#include
#include
#include
int main() {
int i =10;
/* initialize random seed: */
You're not reseeding when you make a child process. The state of the random number generator is exactly the same.
Even if you seed again in your child, you're seeding with the time with a +/- 1 second granularity. When you fork, it all happens in less than a second.
Try seeding it with something different and more random.