Untitled
unknown
plain_text
a year ago
785 B
7
Indexable
include<stdio.h> #include<conio.h> #define max 25 int main() { int nb,np,b[max],p[max],frag[max],i,j,tenp,lowest=10000 static int bf[max],ff[max]; printf("enter the no of blocks: "); scanf("%d",&nb); printf("enter the no of process"); scanf("%d",&np); printf("enter the size of the block :"); for(i=0;i<nb;i++) { printf("block%d",i); scanf("%d",&b[i]); } printf("enter the size of the process :"); for(i=0;i<np;i++) { printf("process%d",i); scanf("%d",&p[i]); } for(i=1;i<np;i++) { for(j=2;j<nb;j++) { if(bf[j]!=1) { temp=b[j]-p[i]; if(temp>=0) { if(lowest >temp) { ff[i]=j; lowest =temp; } } frag[i]=lowest; bf[ff[i]]=1; lowest =10000; } } } printf("\nprocess-no\t\t process size \t\t blockno \tblock size\t fragment"); for
Editor is loading...
Leave a Comment