CS3461 Set 4
CS3461 Set 4
(Regulations 2021)
2. a. Illustrate the following UNIX Commands: Create and list the content in a file (10)
Page 1 of 3
8. a. Write a shell program to find Factorial of a number. (50)
b. Consider the reference string 6, 1, 1, 2, 0, 3, 4, 6, 0, 2, 1, 2, 1, 2, 0, 3, 2, 1, 2, 0 for a memory
with three frames and calculate number of page faults by using LRU in C. (50)
12. a. Develop a Shell program to find whether given number is positive or negative. (50)
b. Implement Semaphore using C. (50)
13. a. Develop a Shell program to find whether given number is Armstrong. (50)
b. Consider the reference string 6, 1, 1, 2, 0, 3, 4, 6, 0, 2, 1, 2, 1, 2, 0, 3, 2, 1, 2, 0 for a memory
with three frames and calculate number of page faults by using Least Recently Used (LRU)
Page replacement algorithms in C. (50)
14. a. Write a shell program to find the area of triangle by getting base and height from user. (50)
b. Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14, 124,
65, 67. The SCAN scheduling algorithm is used. The head is initially at cylinder number 53
moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered
from 0 to 199. Find the total head movement (in number of cylinders) incurred while servicing
these requests using C. (50)
15. a. Develop a Shell program to find area and circumference of a circle. (50)
b. Given five memory partitions of 100Kb, 500Kb, 200Kb, 300Kb, 600Kb (in order), how would
the first-fit algorithm place processes of 212 Kb, 417 Kb, 112 Kb, and 426 Kb (in order)?
Implement it using C. (50)
16. a. Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14, 124,
65, 67. The CLOOK scheduling algorithm is used. The head is initially at cylinder number 53
moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered
from 0 to 199. Find the total head movement (in number of cylinders) incurred while servicing
these requests using C. (100)
Page 2 of 3
18. a. Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14, 124,
65, 67. The C-SCAN scheduling algorithm is used. The head is initially at cylinder number 53
moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered
from 0 to 199. Find the total head movement (in number of cylinders) incurred while servicing
these requests using C. (100)
Page 3 of 3