Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 Write a C program which creates two child processes. One of the child processes must open data1.txt and fill it with 10 random

Question 2 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions