Midterm Os Lab r21
Midterm Os Lab r21
Problem 1 Marks: 15
Write a C program that inputs N numbers through command line parameters and
passes N/2 numbers to each of its child processes through pipes. The child processes
will read the numbers from pipes. Both children will find the mean of the numbers
that they read from pipes and again pass it to parent. Then Parent will compare both
means and display the mean along with the PID of that child that has greater mean.
Output: when N is Odd
Problem 2 Marks: 5
Write a C program that lists all the processes owned by you and associated with your
terminal.
Hint: (Display the list of currently running processes).