Question: write the code in cpp and dont chatgpt, Write a program where the parent process has 7 children. Each child generates 4 random numbers from

write the code in cpp and dont chatgpt, Write a program where the parent process has 7 children. Each child generates
4 random numbers from 1 to 100, calculates their mean, prints it in a new line and
returns. The parent should wait for the children to finish and then return. [10 pts]
Output: 7 random number means calculated by each child.
Rubrics:
The student should have implemented the following things:
File q1.c containing the main function.
The parent process should fork 7 times, possibly in a for loop.
Each child should pick 4 random numbers, average them, print the average.
The parent should call wait()7 times to wait for each of the children.
The printed output should have 4 random means printed one after the other.

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 Programming Questions!