Question: Write a C program which creates two child processes. One of the child processes must open data1.txt and fill it with 10 random integers (0-9).
Write a C program which creates two child processes. One of the child processes must open data1.txt and fill it with 10 random integers (0-9). The other child process must open data2.txt and fill it with 10 random letters (a-z). In the meanwhile, parent must print both child processes' id's and wait for them to finish. Then, it must open both data files and read one data from each file alternatively and print it on screen. Sample Run $ ./question2 [PARENT] Child process ID: 5378 [PARENT] Child process ID: 5379 [CHILD1] Wrote: 6 2 8 6 7 3 3 1 8 4 to file. [CHILD2] Wrote: f y n h j w x k p m to file. [PARENT] 6 f 2 y 8 n 6 h 7 j 3 w 3 x 1 k 8 p 4 m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
