#include< stdio.h>
#include< conio.h>
void main()
{
int i,os_m,nPage,total,pg[25];
clrscr();
printf("\nEnter total memory size:");
scanf("%d",&total);
printf("\nEnter memory for OS:");
scanf("%d",&os_m);
printf("\nEnter no. of pages:");
scanf("%d",&nPage);
for(i=0;i< nPage;i++)
{
printf("Enter size of page[%d]:",i+1);
scanf("%d",&pg[i]);
}
total=total-os_m;
for(i=0;i< nPage;i++)
{
if(total>=pg[i])
{
printf("\n Allocate page %d",i+1);
total=total-pg[i];
}
else
printf("\n page %d is not allocated due to insufficient memory.",i+1);
}
printf("\n External Fragmentation is:%d",total);
getch();
}
OUTPUT
Enter total memory size:1024
Enter memory for OS:256
Enter no. of pages:4
Enter size of page[1]:128
Enter size of page[2]:512
Enter size of page[3]:64
Enter size of page[4]:512
Allocate page 1
Allocate page 2
Allocate page 3
page 4 is not allocated due to insufficient memory.
External Fragmentation is:64
IS NOT GIVEN FOR MFT CODE WHY????
ReplyDeletebetmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
78GR
betmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
E4PCLP
betmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
5XPO
dijital kartvizit
ReplyDeletereferans kimliği nedir
binance referans kodu
referans kimliği nedir
bitcoin nasıl alınır
resimli magnet
MZBP6
erzurum
ReplyDeleteeskişehir
giresun
gümüşhane
hakkari
M2RU0
ataşehir
ReplyDeleteistanbul
çeşme
uşak
samsun
6LQ
تصليح افران غاز مكه yyZMANLkra
ReplyDelete