Question: Creating Processes Using fork0 Due: February 14,2019, 11 am Log onto your Linux system. Under sre directory write C program to carry out the following
Creating Processes Using fork0 Due: February 14,2019, 11 am Log onto your Linux system. Under sre directory write C program to carry out the following task Create two processes and print out their process id& make them work File name: sre/forkTest2.c 1) The parent process creates two children, named as Alice and Bob, respectively 2) The parent prints out the process ID of Alice and Bob when the parent creates them as follows: From Parent: Alice ID is xx llhere xxxx is a positive integer From Parent: Bob ID is yyyy There yyyy is a positive integer printf ("From Parent: Alice ID is %d ", Alice!D); 4) Child Alice calculates the average of number 1,2,, 10, and prints it out as: 3) The parent waits for the two children to finish their work before exiting. From Alice: the average of 1,2,.. 10 is the-average-she-calculated Then exits. 5) Child Bob prints out the following string, then exits From Bob: I am born to print this and then die. Please take a screen shot of displaying the result and save it as result.jpg. Compress two files, forkTest2.c and jpg file into CA2_yourfirstname.zip and upload it on Ecourses
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
