Question: Could you please test and run the program in linux lite and put a screenshot for the code and the output. In this programming assignment
Could you please test and run the program in linux lite and put a screenshot for the code and the output.
In this programming assignment we will try to solve an ancient problem with child processes and forking and forking and forking. In ancient times, Yousef and his friends were trapped in a cave while escaping from the Roman army. Instead of being captured, they decided to suicide. They decided to form a circle in the cave and to kill every third remaining person until on one was left. But Yousef, along with a friend from the group, wanted none of this suicide nonsense. They quickly calculated where he and his friend should stand in the vicious circle.
In our variation of the problem, we start with people numbered from to around a circle, and we eliminate every second remaining person until only one survives. For example, ten people for a circle and elimination started. The elimination order will be so survives. In other words, we need to determine the survivor's number.
In this programming assignment, you required to write a C program using fork system call so that each child process should produce the person who has been eliminated from the sequence and the parent process will determine and write the survivor on the screen.
You should write and test your application in Linux environment. It is strongly recommened that you install the Ubuntu distribution the one for the book and Linux Lite, which is also Ubuntu based, as virtual machine with Virtual Box on your computer. Also, the number of people should be given to the application from the commend line, like:
aout
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
