The snippet below is being run by the child process as well but I don't know why because to my understanding the child's Pid should always be 0 so there's no reason for it to ever do anything below but print "I am child";
pid_t child_Pid1 = fork();
if((int)getpid() == 0) {
printf("I am child\n");
} else {
printf("I am parent\n");
}