Professional Documents
Culture Documents
USING PIPES
AIM
To write a c program to develop an application using Inter process Communication (IPC)
using pipes.
ALGORITHM
1. Initialize an array fd[] and child of integer type
2. Initialize array a of character type.
3. Get the string from user to WRITE in to the pipe
4. Get the string from the user using scanf statement.
5. call the function pipe(fd).
6. assign child as fork().
7. Check if not equal to child
8. Then close index fd of 0
9. Write the string in file destination using write () and wait
10. Else close the index 1 of fd
11. Read the index fd(0),b,5
12. Display the string retrieved from the pipe
pipe():
pipe - create pipe
SYNOPSIS
#include <unistd.h>
int pipe(int filedes[2]);
DESCRIPTION
pipe() creates a pair of file descriptors, pointing to a pipe inode, and places them in the
array pointed to by filedes. filedes[0] is for reading, filedes[1] is for writing.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
PROGRAM
#include<stdio.h>
#include<string.h>
int main()
{
int fd[2],child;
char a[10];
printf("Enter the string to enter into the pipe:");
scanf("%s",a);
pipe(fd);
child=fork();
if(!child)
{
close(fd[0]);
write(fd[1],a,strlen(a));
wait(0);
}
else
{
close(fd[1]);
read(fd[0],a,10);
printf("\n The String retrieved from the pipe is: %s\n",a);
}
return 0;
}
OUTPUT
-bash-4.2$ cc pop.c
-bash-4.2$ ./a.out
Enter the string to enter into the pipe:memory
The String retrieved from the pipe is: memory
RESULT
The C program to develop an application using Inter process Communication (IPC)
using pipes is implemented.
-bash-4.2$ cc jimmy.c
-bash-4.2$ ./a.out
ipc message passing using shared memory-receiver
received message is.... hello
RESULT
The C program to develop an application for Inter process Communication (IPC) using
shared memory is implemented.
EX NO: 8
BANKERS ALGORITHM FOR DEAD LOCK AVOIDANCE
AIM
To implement the bankers Algorithm for Dead Lock Avoidance
ALGORITHM
1. start the program
2. Include the functions for alloc, max, cneed, a ,total.
3. With in main function ,initialize the variables r,p,i,j,k,flag,f,count,x,flag1 of integer type
4. Assign count and flag1 as 0
5. get the values of resources from the user
6. assign f=r.
7. Get the value of total memory for the resources sequentially using for loop
8. Get the number of processes from the user
9. Get the Allocated and Maxneed memory from the user
10. For each process get alloc value and max need memory for each process
11. Calculate the cneed for each process using the formula cneed[i][j]=max[i][j]-alloc[i][j]
12. For each process and resources perform the sequence of execution
13. get the avail value and allocate find and need values
14. check whether it is possible to allocate
15. it is possible then the system is in safe state
16. else system is not in safety state
17. if the new requests comes then the check that the system is in safety
18. stop the program
PROGRAM
#include<stdio.h>
#include<stdlib.h>
int alloc[10][10];
int max[10][10];
int cneed[10][10];
int a[10];
int total[10];
void main()
{
int r,p,i,j,k,flag,f,count,x,flag1;
count=0;
flag1=0;
printf("\nEnter number of resources:");
scanf("%d",&r);
f=r;
printf("\nEnter total memory of given resources sequentially:");
for(i=0;i<r;i++)
scanf("%d",&total[i]);
printf("\nEnter number of processes:");
scanf("%d",&p);
printf("\nEnter Allocated and Maxneed memory…");
for(i=0;i<p;i++)
{
for(j=0;j<r;j++)
{
printf("\nFor Process %d=",i);
scanf("%d%d",&alloc[i][j],&max[i][j]);
//calculating current need
cneed[i][j]=max[i][j]-alloc[i][j];
}
}
printf("\nSequence of execution is…\n");
k=0;
for(j=0;j<r;j++)
{
for(i=0;i<p;i++)
{
a[k]+=alloc[i][j];
}
a[k]=total[k]-a[k];
k++;
}
while(count!=p)
{
for(i=0;i<p;i++)
{
flag=0;
if(cneed[i][f]!=1)
{
for(j=0;j<r;j++)
{
total[j]=a[j]-cneed[i][j];
}
for(k=0;k<r;k++)
{
if(total[k]<0)
{
flag=1;
}
}
}
if((flag==0)&&(cneed[i][f]!=1))
break;
}
x=i;
cneed[x][f]=1;
printf("P%d->",x);
count++;
for(i=0;i<r;i++)
{
total[i]+=max[x][i];
a[i]=total[i];
}
for(i=0;i<p;i++)
{
if((cneed[i][0]<a[0])&&(cneed[i][f]==0))
flag1=1;
}
if(flag1==0)
break;
}
if(flag1==0)
printf("\nUnsafe…");
else
printf("\nSafe…");
getchar();
}
OUTPUT
-bash-4.2$ cc cup.c
-bash-4.2$ ./a.out
-bash-4.2$ cc cup.c
-bash-4.2$ ./a.out
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT:
Thus the program to implement the bankers Algorithm for Dead Lock avoidance has
been executed successfully.
EX NO: 9
IMPLEMENTATION OF DEADLOCK DETECTION
AIM
To write a C program to implement the bankers Algorithm for Dead Lock Detection
ALGORITHM
1. Start the program
2.initialize the variables of integer type found , flag,l,p[4][5],tp,tr,c[4][5], i,j,k=1 ,m[5],
r[5],a[5], temp[5],sum=0.
3. Get the total no of process and total no of resources from user.
4. enter the claim matrix from the user
5. using for loop ,assign I as 1 check if i<=tp and increment the value of i, print the
process.
6.Enter the allocation matrix and again using for loop print the process.
7.using for loop and get the resource vector (total resources) from the user.
8.using for loop and get the availability vector(available sources) from the user.
9.assign temp[i]=a[i] using for(i=1;i<=tp;i++) assign sum=0 and using for(i=1;i<=tp;i+
+) assign sum+=p[i][j].
10. using if condition check if sum==0 and assign m[k]=I and increment the k value.
11.using for assign i=1 and check if i<=tp and using for loop assign l=1 and check if
l<k check whether if i!=m[l] and assign flag=1.
12.using for loop assign j=1 and check if j<=tr and assign flag=0.
13. check if flag==1 then assign m[k]=I and increment the k value.
14. using for loop assign j=1 and check if j<=tr and assign temp[j]+=p[i][j]. And then
print the dead lock causing processes.
15.using for loop assign j=1 and check if j<=tp and assign found=0.
16. using for loop assign i=1 and check if i<k and check if j==m[i] and assign
found=1.
17. then check if found==0, then print the value of j
PROGRAM
#include <stdio.h>
int current[5][5], maximum_claim[5][5], available[5];
int allocation[5] = {0, 0, 0, 0, 0};
int maxres[5], running[5], safe = 0;
int counter = 0, i, j, exec, resources, processes, k = 1;
int main()
{
printf("\nEnter number of processes: ");
scanf("%d", &processes);
for (i = 0; i < processes; i++)
{
running[i] = 1;
counter++;
}
printf("\nEnter number of resources: ");
scanf("%d", &resources);
printf("\nEnter Claim Vector:");
for (i = 0; i < resources; i++)
{
scanf("%d", &maxres[i]);
}
printf("\nEnter Allocated Resource Table:\n");
for (i = 0; i < processes; i++)
{
for(j = 0; j < resources; j++)
{
scanf("%d", ¤t[i][j]);
}
}
printf("\nEnter Maximum Claim Table:\n");
for (i = 0; i < processes; i++)
{
for(j = 0; j < resources; j++)
{
scanf("%d", &maximum_claim[i][j]);
}
}
printf("\nThe Claim Vector is: ");
for (i = 0; i < resources; i++)
{
printf("\t%d", maxres[i]);
}
printf("\nThe Allocated Resource Table:\n");
for (i = 0; i < processes; i++)
{
for (j = 0; j < resources; j++)
{
printf("\t%d", current[i][j]);
}
printf("\n");
}
printf("\nThe Maximum Claim Table:\n");
for (i = 0; i < processes; i++)
{
for (j = 0; j < resources; j++)
{
printf("\t%d", maximum_claim[i][j]);
}
printf("\n");
}
for (i = 0; i < processes; i++)
{
for (j = 0; j < resources; j++)
{
allocation[j] += current[i][j];
}
}
printf("\nAllocated resources:");
for (i = 0; i < resources; i++)
{
printf("\t%d", allocation[i]);
}
for (i = 0; i < resources; i++)
{
available[i] = maxres[i] - allocation[i];
}
printf("\nAvailable resources:");
for (i = 0; i < resources; i++)
{
printf("\t%d", available[i]);
}
printf("\n");
while (counter != 0)
{
safe = 0;
for (i = 0; i < processes; i++)
{
if (running[i])
{
exec = 1;
for (j = 0; j < resources; j++)
{
if (maximum_claim[i][j] - current[i][j] > available[j])
{
exec = 0;
break;
}
}
if (exec)
{
printf("\nProcess%d is executing\n", i + 1);
running[i] = 0;
counter--;
safe = 1;
for (j = 0; j < resources; j++)
{
available[j] += current[i][j];
}
break;
}
}
}
if (!safe)
{
printf("\nThe processes are in unsafe state.\n");
break;
}
else
{
printf("\nThe process is in safe state");
printf("\nAvailable vector:");
for (i = 0; i < resources; i++)
{
printf("\t%d", available[i]);
}
printf("\n");
}
}
return 0;
}
OUTPUT:
-bash-4.2$ vi liv.c
-bash-4.2$ cc liv.c
-bash-4.2$ ./a.out
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT:
Thus the program to implement the bankers Algorithm for Dead Lock Detection has been
executed successfully.
if(pthread_equal(id,tid[0]))
{
printf("\n First thread processing\n");
}
else
{
printf("\n Second thread processing\n");
}
for(i=0; i<(0xFFFFFFFF);i++);
return NULL;
}
int main(void)
{
int i = 0;
int err;
while(i < 2)
{
err = pthread_create(&(tid[i]), NULL, &doSomeThing, NULL);
if (err != 0)
printf("\ncan't create thread :[%s]", strerror(err));
else
printf("\n Thread created successfully\n");
i++;
} sleep(5);
return 0; }
OUTPUT
-bash-4.2$ vi edit.c
-bash-4.2$ cc editt.c -lpthread
First thread processing
Thread created successfully
Second thread processing
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT
Thus the program has been executed and verified successfully.
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT
Thus the program was executed and output was verified successfully
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT
Thus the program was executed and output was verified successfully.
OUTPUT
-bash-4.2$ cc pagee.c
-bash-4.2$ ./a.out
ENTER THE NUMBER OF PAGES:
10
ENTER THE PAGE NUMBER :
5
2
5
6
8
9
1
2
4
6
ENTER THE NUMBER OF FRAMES :2
ref string page frames
5 5 -1
2 5 2
5
6 6 2
8 6 8
9 9 8
1 9 1
2 2 1
4 2 4
6 6 4
Page Fault Is 9
RESULT
Thus C program to implement FIFO Page Replacement Algorithm was written, executed
and output is verified successfully.
-bash-4.2$ vi doitt2.c
-bash-4.2$ cc doitt2.c
-bash-4.2$ ./a.out
Enter number of frames: 3
Enter number of pages: 6
Enter reference string: 5
4
3
6
7
3
5 -1 -1
5 4 -1
5 4 3
6 4 3
6 7 3
6 7 3
Total Page Faults = 5
RESULT
Thus C program to implement LRU Page Replacement Algorithm was written, executed
and output is verified successfully.
OUTPUT
-bash-4.2$ cc doitt3.c
-bash-4.2$ ./a.out
Enter Total Number of Frames: 4
Enter Total Number of Pages: 5
Enter Values for Reference String:
Value No.[1]: 5
Value No.[2]: 3
Value No.[3]: 5
Value No.[4]: 2
Value No.[5]: 1
5 -1 -1 -1
5 3 -1 -1
5 3 -1 -1
5 3 2 -1
5 3 2 1
Total Number of Page Faults: 0
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT
Thus C program to implement LFU Page Replacement Algorithm was written, executed
and output is verified successfully.
RESULT:
Thus C program to implement Single-Level File Organization Technique was written,
executed and output is verified successfully.
ALGORITHM
PROGRAM
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct
{
char dname[10],fname[10][10];
int fcnt;
}dir[10];
void main()
{
int i,ch,dcnt,k;
char f[30], d[30];
dcnt=0;
while(1)
{
printf("\n\n1. Create Directory\t2. Create File\t3. Delete File");
printf("\n4. Search File\t\t5. Display\t6. Exit\t Enter your choice");
scanf("%d",&ch);
switch(ch)
{
case 1: printf("\nEnter name of directory -- ");
scanf("%s", dir[dcnt].dname);
dir[dcnt].fcnt=0;
dcnt++;
printf("Directory created");
break;
case 2: printf("\nEnter name of the directory -- ");
scanf("%s",d);
for(i=0;i<dcnt;i++)
if(strcmp(d,dir[i].dname)==0)
{
printf("Enter name of the file -- ");
scanf("%s",dir[i].fname[dir[i].fcnt]);
dir[i].fcnt++;
printf("File created");
break;
}
if(i==dcnt)
printf("Directory %s not found",d);
break;
case 3: printf("\nEnter name of the directory -- ");
scanf("%s",d);
for(i=0;i<dcnt;i++)
{
if(strcmp(d,dir[i].dname)==0)
{
printf("Enter name of the file -- ");
scanf("%s",f);
for(k=0;k<dir[i].fcnt;k++)
{
if(strcmp(f, dir[i].fname[k])==0)
{
printf("File %s is deleted ",f);
dir[i].fcnt--;
strcpy(dir[i].fname[k],dir[i].fname[dir[i].fcnt]);
goto jmp;
}
}
printf("File %s not found",f);
goto jmp;
}
}
printf("Directory %s not found",d);
jmp : break;
case 4: printf("\nEnter name of the directory -- ");
scanf("%s",d);
for(i=0;i<dcnt;i++)
{
if(strcmp(d,dir[i].dname)==0)
{
printf("Enter the name of the file -- ");
scanf("%s",f);
for(k=0;k<dir[i].fcnt;k++)
{
if(strcmp(f, dir[i].fname[k])==0)
{
printf("File %s is found ",f);
goto jmp1;
}
}
printf("File %s not found",f);
goto jmp1;
}
}
printf("Directory %s not found",d);
jmp1: break;
case 5: if(dcnt==0)
printf("\nNo Directory's ");
else
{
printf("\nDirectory\tFiles");
for(i=0;i<dcnt;i++)
{
printf("\n%s\t\t",dir[i].dname);
for(k=0;k<dir[i].fcnt;k++)
printf("\t%s",dir[i].fname[k]);
}
}
break;
default:exit(0);
}
}
}
OUTPUT
-bash-4.2$ cc king.c
-bash-4.2$ ./a.out
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice1
Enter name of directory -- flower
Directory created
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice2
Enter name of the directory -- flower
Enter name of the file -- rose.c
File created
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice2
Enter name of the directory -- flower
Enter name of the file -- jasmine.c
File created
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice3
Enter name of the directory -- flower
Enter name of the file -- rose.c
File rose.c is deleted
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice5
Directory Files
flower jasmine.c
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice4
Enter name of the directory -- flower
Enter the name of the file -- rose.c
File rose.c not found
1. Create Directory 2. Create File 3. Delete File
4. Search File 5. Display 6. Exit Enter your choice6
RESULT
Thus C program to implement Two-Level File Organization Technique was written,
executed and output is verified successfully.
OUTPUT
RESULT:
EX NO: 14 (D)
IMPLEMENTATION OF DAG FILE ORGANIZATION TECHNIQUE
AIM
To write a C program to implement DAG File Organization Technique.
ALGORITHM
Step 1: Start the program.
Step 2: Create a structure to generate levels.
Step 3: Intialize the graphics window.
Step 4: Display the root directory based on which get the sub directories and files.
Step 5: Based on the files and directories create a DAG file organization.
Step 6: Get the links from the user and display the structure and the link.
Step 6: Stop the program.
PROGRAM
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
struct tree_element
{
char name[20];
int x,y,ftype,lx,rx,nc,level;
struct tree_element *link[5];
};
typedef struct tree_element node;
typedef struct
{
char from[20]; char to[20];
}link;
link L[10]; int nofl; node *root;
void main()
{
int gd=DETECT,gm; root=NULL;
clrscr();
create(&root,0,"root",0,639,320);
read_links();
clrscr(); initgraph(&gd,&gm,"c:\\Turboc3\\BGI");
draw_link_lines();
display(root); getch(); closegraph();
}
create(node **root,int lev,char *dname,int lx,int rx,int x)
{
int i,gap; if(*root==NULL)
{
(*root)=(node*)malloc(sizeof(node));
printf("\nEnter name of dir/file(under %s):",dname); fflush(stdin);
gets((*root)->name);
printf("\nEnter 1 for Dir/2 for File:");
scanf("%d",&(*root)->ftype); (*root)->level=lev;
(*root)->y=50+lev*50; (*root)->x=x;
(*root)->lx=lx; (*root)->rx=rx; for(i=0;i<5;i++)
(*root)->link[i]=NULL; if((*root)->ftype==1)
{
printf("\nNo of Sub Directories/Files(for %s):",(*root)->name);
scanf("%d",&(*root)->nc);
if((*root)->nc==0)
gap=rx-lx;
else
gap=(rx-lx)/(*root)->nc; for(i=0;i<(*root)->nc;i++)
create(&((*root)->link[i]),lev+1,(*root)->name,lx+gap*i,lx+gap*i+gap,lx+gap*i+gap/2);
}
else
(*root)->nc=0;
}
}
read_links()
{
int i;
printf("\nHow many Links:");
scanf("%d",&nofl); for(i=0;i<nofl;i++)
{
printf("\nFile/Dir:");
fflush(stdin); gets(L[i].from);
printf("\nUser Name:");
fflush(stdin);
gets(L[i].to);
}
}
draw_link_lines()
{
int i,x1,y1,x2,y2;
for(i=0;i<nofl;i++)
{
search(root,L[i].from,&x1,&y1);
search(root,L[i].to,&x2,&y2);
setcolor(LIGHTGREEN);
setlinestyle(3,0,1);
line(x1,y1,x2,y2);
setcolor(YELLOW);
setlinestyle(0,0,1);
}
}
search(node *root,char *s,int *x,int *y)
{
int i;
if(root!=NULL)
{
if(strcmpi(root->name,s)==0)
{
*x=root->x;
*y=root->y; return;
}
else
{
for(i=0;i<root->nc;i++)
search(root->link[i],s,x,y);
}
}
}
display(node *root)
{
int i;
settextstyle(2,0,4);
settextjustify(1,1);
setfillstyle(1,BLUE);
setcolor(14);
if(root!=NULL)
{
for(i=0;i<root->nc;i++)
{
line(root->x,root->y,root->link[i]->x,root->link[i]->y);
}
if(root->ftype==1)
bar3d(root->x-20,root->y-10,root->x+20,root->y+10,0,0);
else
fillellipse(root->x,root->y,20,20);
outtextxy(root->x,root->y,root->name); for(i=0;i<root->nc;i++)
{
display(root->link[i]);
}
}
}
OUTPUT
Preparation (5)
Performance (5)
Record (5)
Viva (5)
Total (20)
RESULT
Thus C program to implement DAG File Organization Technique was written, executed
and output is verified successfully.
OUTPUT
RESULT
Thus C program to implement Sequential File Allocation Strategy was written, executed
and output is verified successfully.
EX NO: 15 (B)
IMPLEMENTATION OF LINKED FILE ALLOCATION STRATEGY
AIM
To write a C program to implement Linked File Allocation Strategy.
ALGORITHM
Step 1: Create a queue to hold all pages in memory
Step 2: When the page is required replace the page at the head of the queue
Step 3: Now the new page is inserted at the tail of the queue
Step 4: Create a stack
Step 5: When the page fault occurs replace page present at the bottom of the stack
Step 6: Stop the allocation.
PROGRAM
#include<stdio.h>
#include<conio.h>
struct fileTable
{
char name[20];
int sb, nob;
}ft[30];
void main()
{
int i, j, n;
char s[20];
clrscr();
printf("Enter no of files :");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter file name %d :",i+1);
scanf("%s",ft[i].name);
printf("Enter starting block of file %d :",i+1);
scanf("%d",&ft[i].sb);
printf("Enter no of blocks in file %d :",i+1);
scanf("%d",&ft[i].nob);
}
printf("\nEnter the file name to be searched-- ");
scanf("%s",s);
for(i=0;i<n;i++)
if(strcmp(s, ft[i].name)==0)
10
break;
if(i==n)
printf("\nFile Not Found");
else
{
printf("\nFILE NAME START BLOCK NO OF BLOCKS BLOCKS OCCUPIED\n");
printf("\n%s\t\t%d\t\t%d\t",ft[i].name,ft[i].sb,ft[i].nob);
for(j=0;j<ft[i].nob;j++)
printf("%d, ",ft[i].sb+j);
}
getch();
}
OUTPUT
Enter no of files :3
Enter file name 1 :A
Enter starting block of file 1 :85
Enter no of blocks in file 1 :6
Enter file name 2 :B
Enter starting block of file 2 :102
Enter no of blocks in file 2 :4
EX NO: 15 (C)
IMPLEMENTATION OF INDEXED FILE ALLOCATION STRATEGY
AIM
To write a C program to implement indexed File Allocation Strategy.
ALGORITHM
Step 1: Start.
Step 2: Let n be the size of the buffer
Step 3: check if there are any producer
Step 4: if yes check whether the buffer is full
Step 5: If no the producer item is stored in the buffer
Step 6: If the buffer is full the producer has to wait
Step 7: Check there is any consumer.If yes check whether the buffer is empty
Step 8: If no the consumer consumes them from the buffer
Step 9: If the buffer is empty, the consumer has to wait.
Step 10: Repeat checking for the producer and consumer till required
Step 11: Terminate the process.
PROGRAM
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int f[50], index[50],i, n, st, len, j, c, k, ind,count=0;
clrscr();
for(i=0;i<50;i++)
f[i]=0;
x:printf("Enter the index block: ");
scanf("%d",&ind);
if(f[ind]!=1)
{
printf("Enter no of blocks needed and no of files for the index %d on the disk : \n", ind);
scanf("%d",&n);
}
else
{
printf("%d index is already allocated \n",ind);
goto x;
}
y: count=0;
for(i=0;i<n;i++)
{
scanf("%d", &index[i]);
if(f[index[i]]==0)
count++;
}
if(count==n)
{
for(j=0;j<n;j++)
f[index[j]]=1;
printf("Allocated\n");
printf("File Indexed\n");
for(k=0;k<n;k++)
printf("%d-------->%d : %d\n",ind,index[k],f[index[k]]);
}
else
{
printf("File in the index is already allocated \n");
printf("Enter another file indexed");
goto y;
}
printf("Do you want to enter more file(Yes - 1/No - 0)");
scanf("%d", &c);
if(c==1)
goto x;
else
exit(0);
getch();
}
OUTPUT
Enter the index block: 5
Enter no of blocks needed and no of files for the index 5 on the disk :
4
1234
Allocated
File Indexed
5-------->1 : 1
5-------->2 : 1
5-------->3 : 1
5-------->4 : 1
Do you want to enter more file(Yes - 1/No - 0)1
Enter the index block: 4
4 index is already allocated
Enter the index block: 6
Enter no of blocks needed and no of files for the index 6 on the disk :
2
78
Preparation (5)
A5llocated
File Indexed Performance (5)
Record (5)
Viva (5)
Total (20)
6-------->7 : 1
6-------->8 : 1
Do you want to enter more file(Yes - 1/No - 0)0
RESULT
Thus the program to implement the indexed file allocation was executed successfully and
output was verified.