Implementation of Sequential File Allocation Technique
Implementation of Sequential File Allocation Technique
ALGORITHM:
STEP 1: Start the program.
STEP 8: Print the file number, length, and the block allocated.
PROGRAM:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
printf("Enter the starting block and the length of the files: ");
if (files[j] == 0)
flag++;
if(len == flag){
if (files[k] == 0){
files[k] = 1;
printf("%d\t%d\n", k, files[k]);
if (k != (startBlock+len-1))
else
scanf("%d", &ch);
if (ch == 1)
recurse(files);
else
exit(0);
return;
int main()
int files[50];
for(int i=0;i<50;i++)
files[i]=0;
recurse(files);
getch();
return 0;
SAMPLE INPUT/OUTPUT:
Files Allocated are :
2 1
3 1
4 1
5 1
6 1
RESULT:
Thus implementation the sequential file allocation technique is implemented successfully.