Question: Write a C program where child processes are forked in this way: - the original process creates two child processes - each process created from

Write a C program where child processes are forked in this way:- the original process creates two child processes- each process created from the original process creates two child processesEach process is given a unique process number in range l..7 in this way:-
the original process is numbered 1-
the two processes created by process 1 are numbered 2 and 3-
the two processes created by process 2 are numbered 4 and 5-
the two processes created by process 3 are numbered 6 and 7
Your program receives 7 arguments from command line. These arguments are expected to be natural numbers. You do not need to handle wrong inputs. Each process will go to sleep for some time after having created child processes if needed. The number of seconds a process numbered i is put to sleep is the ith argument.The sleep time can be considered the simulation of the different computation time each process takes to carry out its subtask.Before each process terminates, print out its process number and process id. I am also attaching sample run image that what kind of out put i want.
 Write a C program where child processes are forked in this

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!