Simulate MVT
#include<stdio.h>
#include<conio.h>#include<math.h>
void main()
{
int mm,osm,size[1000],i,n,rem,part;
clrscr();
printf("Enter Total Memory Size:");
scanf("%d",&mm);
printf("\nEnter OS Size:");
scanf("%d",&osm);
mm=mm-osm;
printf("\nRemaming memory for use is:%d",mm);
while(1)
{
printf("\nEnter size of process : ");
scanf("%d", &size[i]);
if (size[i] <= mm)
{
printf("\nProcess is allotted\n");
mm=mm-size[i];
}
else if(mm<=0){
break;
}
else
printf("\nProcess is blocked\n");
}
printf("Total External fragmentation : %d\n", mm);
getch();
}
Comments
Post a Comment