Question: Considering the program name fork.c and answer the following questions #include #include #include int a = 0: void main (void) int i-1 sprintf (buf, A

 Considering the program name fork.c and answer the following questions #include

#include #include int a = 0: void main (void) int i-1 sprintf

(buf, "A %d ", a); write (1, buf, strlen (buf)) fork) att

Considering the program name fork.c and answer the following questions #include #include #include int a = 0: void main (void) int i-1 sprintf (buf, "A %d ", a); write (1, buf, strlen (buf)) fork) att sprintf (buf, "B %d ", a); write (1, buf, strlen (buf)) fork) att sprintf (buf, "C %d ", a); write (1, buf, strlen (buf)) A user compiles the file from command line >gcc fork.c, an executable file a.out is created, then the user runs the executable from command line. Answer the following questions based on the understanding of the code and execution. wer the folluwing questions based on th, the 1. How many letter A' in total are printed in the output trace? A. 1 Answer How many letter 'B' in total are printed in the output trace? A. 1 Answer B. 2 C. 4 D. 7 if you come up with a different answer or 2. B. 2 C. 4 D. 7 if you come up with a different answer or How many letter 'C" in total are printed in the output trace? A. 1 Answer_ B. 2 C. 4 D. 7 if you come up with a different answer or 4. Where the variable a is stored in the process' address space? A. Text segment B. Data segment C. Heap segment D. Stack segment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!