Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C / C + + programming that does the following: a . Create a new process child 1 b . The parent (

Write a C/C++ programming that does the following:
a. Create a new process child1
b. The parent (of child1) should print its id and wait for the termination of the child1
process
c. The child1 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 child1 process should create a new child process (child2)
e. The child2 process should call a function that adds two numbers passed as
arguments and print the result along with its pid while child1 waits
f. Control should then come back to the first child process child1 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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions