IDNLearn.com provides a collaborative environment for finding and sharing answers. Find reliable solutions to your questions quickly and easily with help from our experienced experts.
Sagot :
Answer:
hope this helps,do consider giving brainliest
Explanation:
int main() {
int i,pid; printf("pid : %d \n",pid);
pid=fork();
printf("pid : %d \n",pid);
printf("\n");
if(pid==0) {
printf("Child starts\n");
for(i=0;i<5;i++) {
printf("i : %d\n",i);
printf("\n");
}
printf("Child ends\n");
}
else {
printf("\nBefore wait\n");
printf("getpid : %d\n",getpid());
pid=wait(0);
printf("\npid : %d\n",pid);
printf("After wait\n");
printf("Parent\n");
printf("getpid : %d\n",getpid());
}
}
We appreciate your presence here. Keep sharing knowledge and helping others find the answers they need. This community is the perfect place to learn together. For trustworthy and accurate answers, visit IDNLearn.com. Thanks for stopping by, and see you next time for more solutions.