Write a program file2.c: Program file2.c requires two arguments to obtain the approximate value of e x by adding the first n terms in the relation : e x = 1 + x + x 2 /2! + x 3 / 3! +....... and prints the result in the format: Child(PID=yyy) : For x = 0.5 the first 5 terms yields 1.6484375
Write a
Program file2.c requires two arguments to obtain the approximate value of e x by adding the first n terms in the relation : e x = 1 + x + x 2 /2! + x 3 / 3! +.......
and prints the result in the format:
Child(PID=yyy) : For x = 0.5 the first 5 terms yields 1.6484375
Hint : Child-specific processing immediately following the fork() command should load file2.c into the newly created process using the exec() command. This exec() command should also pass 2 arguments to the child. Refer to the man page of exec() command to know how to pass on arguments to the child process. Parent specific processing should ensure that the parent will wait() for the child- specific processing to complete.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images