Question: Create a program that asks for the number of children to create, and two other integer numbers. The program then assigns one arithmetic operation to

Create a program that asks for the number of children to create, and two other
integer numbers. The program then assigns one arithmetic operation to each child
to execute, use only the four basic arithmetic operations, namely:
Addition (10+5=15) : Assign this operation to the first child
Subtraction (10-5=5) : Assign this operation to the second child
Multiplication (10**5=50): Assign this operation to the third child
Division (10/5=2) : Assign this operation to the fourth child
Requirements
Create a function with the name "childCode" for the child process code. This
function doesn't return anything at all (void). This function must use if statements
to decide which arithmetic operation it needs to execute and print.
For each child make sure it prints its own process id and the result of the assigned
arithmetic operation.
If the user requests less than 4 children, then execute only the operations up to the
number of children requested and end the program.
If the user requests more than 4 children, then execute all the operations and for all
the additional children print this message: "Child with pid#XXXX says: I'm a child
with no task!"
 Create a program that asks for the number of children to

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!