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

All programs should be in C language. Write a C language programto demonstrate creation and execution of a child process through fork( function.Use getpid0 and getppid0 functions to print IDs of child and parentprocesses. I Write a program that reads the details of 5 programsAll 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!