when i run this code i get the message "this is child1" twice.. its only suppose to run one time?? am i doing anything wrong
Code:pid_t childpid1, childpid2; int main() { printf("Create 2 processes\n"); childpid1 = fork(); childpid2 = fork(); int i = 0; if (childpid1 == 0 && i==0) { printf("\nthis is child 1\0"); }; if (childpid2 == 0 && i==1) { printf("\nthis is child 2\0"); }; exit(0); }