calculating factorial in unix

May 13, 2011 at 17:12:43
Specs: Windows XP
The parent process (main.cpp) should:
• ask the user for the integer n
• create a new child process (factorial.cpp) to determine the factorial of the integer n
• pass the integer n to the child process via pipe
• receive the factorial of the integer n from the child process and displays it to the user
• continue to ask the user for an integer n and pass it to the child process to calculate the factorial
of the integer until the user enters -1 to quit the program. The parent should not create a new
child. The existing child should be used.

The child process (factorial.cpp) should:
• receive the integer n from the parent process via pipe and calculates the factorial
• send the factorial to the parent to via pipe. The child process should not display
• waits to read another integer from the pipe

See More: calculating factorial in unix

Report •

Report •
Related Solutions

Ask Question