0% found this document useful (0 votes)
4 views1 page

Midterm Os Lab r21

The document outlines the midterm exam for an Operating System lab, scheduled for Summer 2021, with a total of 20 marks and a duration of 90 minutes. It includes two programming problems: the first requires writing a C program to calculate and compare means from command line input using child processes, while the second asks for a C program to list all processes owned by the user. Specific instructions for compiling the programs and handling odd/even cases for the first problem are also provided.

Uploaded by

zaryabimran222
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Midterm Os Lab r21

The document outlines the midterm exam for an Operating System lab, scheduled for Summer 2021, with a total of 20 marks and a duration of 90 minutes. It includes two programming problems: the first requires writing a C program to calculate and compare means from command line input using child processes, while the second asks for a C program to list all processes owned by the user. Specific instructions for compiling the programs and handling odd/even cases for the first problem are also provided.

Uploaded by

zaryabimran222
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Operating System (Lab) Midterm Summer 2021

Time allowed: 90 Minutes (1 Hours and 30 Minutes)


Total Marks: 20
Instructions
• Every program must be compiled with -Wall and -Werror options.
• Understanding the problem is part of the problem.

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

Output: when N is Even

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).

You might also like