Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All programs should be in C language. Write a C language program to demonstrate creation and execution of a child process through fork( function. Use

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedAll programs should be in C language.

Write a C language program to demonstrate creation and execution of a child process through fork( function. Use getpid0 and getppid0 functions to print IDs of child and parent processes. I Write a program that reads the details of 5 programs into an array of structures. Use the following typedef. Your program should then display the contents of each PCB on the screen as shown below: typedef struct { int id; char name[10] owner; int memory: char status[15]; } PCB; ; CURRENT JOBS ID OWNER 10 Khalid 21 Hamza 23 System 56 Khalid 70 Khalid MEMORY (MB) 10 3 20 2 35 STATUS Running Ready Waiting Ready Ready The file, memory.txt, contains data records of memory and disk requirements (in MB) for five processes currently running on a computer. Each data record (line in the "memory.txt" file) consists of two values, memory requirement (MB) and disk requirement (MB) for one process. Write a program that reads the data from this file and computes the total memory and disk requirements for all the processes. Your result should be stored in a file, total_memory.txt, as shown below: Note: Each call to fscanf should read 2 values (memory requirement and disk requirement). Use a for loop to carry out repetition. memory.txt 200 100 90 10 20 10 50 30 0 10 total memory.txt Total memory requirement is 420 MB Total disk requirement is 100 MB

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago