Back To Back
Back To Back
Write a simulation program for disk scheduling using FCFS algorithm. Accept total number of disk
blocks, disk request string, and current head position from the user. Display the list of request in the
order in which it is served. Also display the total number of head moments.
55, 58, 39, 18, 90, 160, 150, 38, 184
Start Head Position: 50
#include <stdio.h>
#include <stdlib.h> // Include this to use the abs function
int main() {
int n; // Number of disk requests
int requests[100]; // Array to store disk requests
int currentHead; // Current head position
int totalHeadMovements = 0; // Total head movements
return 0;
}
OUTPUT:-
Enter the total number of disk requests: 9
Enter the disk request string (space-separated): 55 58 39 18 90 160 150 38 184
Enter the Start Head Position: 50
Order of requests served:
55 58 39 18 90 160 150 38 184
Total Head Movements: 458