Question: Write a C / C + + programming that does the following: a . Create a new process child 1 b . The parent (
Write a CC programming that does the following:
a Create a new process child
b The parent of child should print its id and wait for the termination of the child
process
c The child process should call a function that subtracts two numbers passed as
arguments and print the result on the console screen along with the pid of the process
that is printing
d The child process should create a new child process child
e The child process should call a function that adds two numbers passed as
arguments and print the result along with its pid while child waits
f Control should then come back to the first child process child that now should call a
function that multiplies two numbers passed as arguments and print the result and pid
of the printing process to the console and then terminate
g The waiting parent process should now resume and terminate the program
h Note: arguments to functions may be hard coded or taken in as user input
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
