Write a c/c++ program that forks five processes from the same parent. The first process should find
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a c/c++ program that forks five processes from the same parent. The first process should find the prime numbers in the range 2-2000 and save them in a file named primes_2_2000.txt. The second process should find the prime numbers in the range 2001-4000 and save them in a file named primes_2001_4000.txt. The third process should find the prime numbers in the range 4001-6000 and save them in a file named primes_4001_6000.txt. The fourth process should find the prime numbers in the range 6001-8000 and save them in a file named primes_6001_8000.txt. The fifth process should find the prime numbers in the range 6001-8000 and save them in a file named primes_8001_10000.txt. The parent process should wait for the children to terminate.
Related Book For
Posted Date: