Question 18
Which of the following can be possible output of the following lines of code?
#include<stdio.h>#include<stdlib.h>int main() { int a, pid; a = 30; pid = fork(); if(pid == 0) { printf("Parent\t %d\n", a); } else { printf("Child\t %d\n", a); a = 25; printf("Child\t %d\n", a); } return 0;}Figure 2:
Child 30
Child 25
Parent 30Child 30
Child 25
Parent 25Parent 30
Child 30
Child 25Parent 25
Child 30
Child 25