Question: Only need program B in C code with Linux/Unix environment! Create a program that reads the following set numbers: 2,3, 7, -1, 10, 6 and

 Only need program B in C code with Linux/Unix environment! Create

Only need program B in C code with Linux/Unix environment!

Create a program that reads the following set numbers: 2,3, 7, -1, 10, 6 and store these numbers into an array. The program (parent) should create a child (slave) and send the array to the child. The child will compute the summation of its array and will return the summation to its parent. Finally, the parent will print the final result using the standard output (printf) Example of execution and expected outcome >/ProgramA >I am the parent with process ID:XXX >>I am the child with process ID:XXX and I am sending 27 to my parent I am the parent with process ID:XXX with a final sum of 27 ProgramB Here, you can recycle most of the code from ProgramA. The only difference is that now the parent program will create a variable number of children (for this problem 2 or 3) instead of just one child, and it will send a piece of the array to each child. Each child will compute the summation of its array and it will print it along with its process ID Then, each child will send the summation to its parent. The parent will collect the partial summation from its children, and it will add these values. Finally, the parent will print the final sum using the standard output (printf). Example 1 of execution and expected outcome >>/ProgramB 2 >>I am the parent with process I >>I am a child with process ID: XXX and my partial summation is: 12 >>I am a child with process ID: XXX and my partial summation is: 15 >>I am the parent with process ID: XXX and the final sum is: 27 D:XXX Example 2 of execution and expected outcome >>/ProgramB 3 >>I am the parent with process I >>I am a child with process ID: XXX and my partial summation is: 5 >>I am a child with process ID: XXX and my partial summation is: 6 >>I am a child with process ID: XXX and my partial summation is: 16 >>I am the parent with process I D:XXX D: XXX and the final sum is: 27

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!