rohithdsouza

linked file allocation os lab

Feb 24th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main()
  4. {
  5. char filename[20];
  6. int startblock,blocksize,i,fb;
  7. int freeblock[20];
  8.  
  9. printf("\n enter the file name");
  10. scanf("%s",filename);
  11. printf("\n enter the starting block and blocksize: ");
  12. scanf("%d%d",&startblock,&blocksize);
  13. printf("\n enter the number free blocks");
  14. scanf("%d",&fb);
  15. printf("\n
  16. for(i=0;i<fb;i++)
  17. {
  18. scanf("%d",&freeblock[i]);
  19. }
  20. printf("\n\n the file name is : %s",filename );
  21. printf("\nthe linked list file allocation is\n ");
  22. printf("%d->",startblock);
  23. for(i=0;i<blocksize-1;i++)
  24. {
  25. printf("%d->",freeblock[i]);
  26. }
  27.  
  28. }
Add Comment
Please, Sign In to add comment