Search for question
Question

What is the output generated by this program? In fact, the output is not uniquely defined, i.e., it is not always the same. So please give three examples of possible outputs. Briefly justify/explain your answer. int i = 0; main() { } printf("%d\n", i); /* print i on a line */ fork(); i=i+1; printf("%d\n", i); fork(); i=i+1; printf("%d\n", i);

Fig: 1