fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int n,i,j,b[20],sb[20],t[20],x,c[20][20];
  6.  
  7. printf("Enter no.of files:");
  8. scanf("%d",&n);
  9. for(i=0;i<n;i++)
  10. {
  11. printf("Enter no. of blocks occupied by file%d",i+1);
  12. scanf("%d",&b[i]);
  13. printf("Enter the starting block of file%d",i+1);
  14. scanf("%d",&sb[i]);
  15. t[i]=sb[i];
  16. for(j=0;j<b[i];j++)
  17. c[i][j]=sb[i]++;
  18.  
  19. printf("%d",c[i][j]);
  20. }
  21. printf("Filename\tStart block\tlength\n");
  22. for(i=0;i<n;i++)
  23. printf("%d\t %d \t%d\n",i+1,t[i],b[i]);
  24. }
  25.  
Success #stdin #stdout 0s 5304KB
stdin
2
12
8
stdout
Enter no.of files:Enter no. of blocks occupied by file1Enter the starting block of file10Enter no. of blocks occupied by file2Enter the starting block of file20Filename	Start block	length
1	 8 	12
2	 32767 	0