Join the growing community of curious minds on IDNLearn.com. Find the information you need quickly and easily with our reliable and thorough Q&A platform.
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());
}
}