c lookdisk
DESCRIPTION
c++ progTRANSCRIPT
Output- c-look disk scheduling algorithmenter maximum no. of cylinders of disk you want to access898 183 37 122 14 124 65 67enter the direction from where you want to start left'0' , right'1'1enter the initial position of cylinder53
65 67 98 122 124 183 14 37
Process returned 0 (0x0) execution time : 24.437 sPress any key to continue.
#include#include#include#include#includeusing namespace std;int main(){ int n,start,counti=0,mini,pos,direc; printf("enter maximum no. of cylinders of disk you want to access\n"); scanf("%d",&n); int arr[30]; for(int i=0;i=0;i--) { printf("%d ",arr[i]); } for(int i=n-1;i>mid;i--) { printf("%d ",arr[i]); } } if(direc==1) { for(int i=mid;i