Question: Exercise 5 - Programming with fork Write a C program called sumfact.c that does the following: Takes an integer argument ( say , N 1
Exercise Programming with fork
Write a C program called sumfact.c that does the following:
Takes an integer argument say N from the command line.
Forks two children processes
a First child computes dotssum of positive integers up to N and prints out the result
and its own identifier.
b Second child computes dotsthe factorial of N and prints out the result and its own
identifier.
Parent waits until both children are finished, then prints out the message "Done" and its own
identifier.
Sample execution assuming the executable is called sumfact:
bash$sumfact
ID Sum of positive integers up to is
ID Factorial of is
Done
Help me about it please
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
