Created
October 20, 2020 13:19
-
-
Save projjal1/dc2292e23b46ec0dd06c65764c063a99 to your computer and use it in GitHub Desktop.
FCFS Scheduling in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void fcfs(int arr[],int n,int cur_block) | |
{ | |
//First print the current block | |
printf("%d ",cur_block); | |
for(int i=0;i<n;i++) | |
{ | |
cur_block=arr[i]; | |
printf("%d ",cur_block); | |
} | |
} | |
int main(void) | |
{ | |
//Array of blocks | |
int arr[]={98,183,37,122,12,124,65,67}; | |
//Current block | |
int cur_block=53; | |
//Size of disk | |
int n=sizeof(arr)/sizeof(int); | |
//Display | |
printf("Order of seek : - \n"); | |
//First print the block | |
fcfs(arr,n,cur_block); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment