└── sequentialfile /sequentialfile: -------------------------------------------------------------------------------- 1 | #include 2 | main() 3 | { 4 | int f[50],i,st,j,len,c,k; 5 | clrscr(); 6 | for(i=0;i<50;i++) 7 | f[i]=0; 8 | X: 9 | printf("\n Enter the starting block & length of file"); scanf("%d%d",&st,&len); 10 | for(j=st;j<(st+len);j++) 11 | if(f[j]==0) 12 | { 13 | } 14 | else 15 | { 16 | } 17 | f[j]=1; 18 | printf("\n%d->%d",j,f[j]); 19 | printf("Block already allocated"); 20 | break; 21 | if(j==(st+len)) 22 | printf("\n the file is allocated to disk"); printf("\n if 23 | u want to enter more files?(y-1/n-0)"); scanf("%d",&c); 24 | if(c==1) 25 | goto X; 26 | else 27 | exit(); 28 | getch(); 29 | } 30 | --------------------------------------------------------------------------------