#include #include void firstfit(int block,int process,int s,int t,int tot){    printf(”

Firstfit
“); int i,j,x,r,sum=0; for(i=0;ipro)    printf(“External fragmentation:%d

“,pro);    else        printf(“No External fragmentation

“);}void sortarray(int arr,int x){   // printf(“%d
“,x);    int i,j,temp;    for(i=0;iarrj)        {            temp=arri;            arri=arrj;            arrj=temp;        }    }   /* for(i=0;ipi)        {            y=y+pi;           // printf(“%d
“,r3);        }    }*/   // printf(“Total External fragmentation:%d
“,s+y);    printf(“Total Internal fragmentation:%d
“,tot);    printf(“Total Unallocated memory:%d
“,sum);     int pro=0,exter=0;    for(i=0;ipro)    printf(“External fragmentation:%d

“,pro);    else        printf(“No External fragmentation

“);}void sortarray2(int arr){    int x=sizeof(arr);   // printf(“%d
“,x);    int i,j,temp;    for(i=x;i>=0;i–)        for(j=i-1;j>=0;j–)    {        if(arri>arrj)        {            temp=arri;            arri=arrj;            arrj=temp;        }    }   /* for(i=0;ibj &&kj==0)          {              y=pi;            s=s+bj;          } */        }    }   // printf(“Total External fragmentation:%d
“,s+y);    printf(“Total Internal fragmentation:%d
“,tot);    printf(“Total Unallocated Memory:%d
“,sum);     int pro=0,exter=0;    for(i=0;ipro)    printf(“External fragmentation:%d

“,pro);    else        printf(“No External fragmentation

“);}int main(){   /* int b5={100,500,200,300,600};    int p5={212,417,112,426};  //  printf(“%d
“,sizeof(b)/sizeof(int));    firstfit(b,p,5,4);    int b25={100,500,200,300,600};    int p25={212,417,112,426};    bestfit(b2,p2,5,4);    int b35={100,500,200,300,600};    int p35={212,417,112,426};    worstfit(b3,p3,5,4); */    int a,c,e,f,sumup=0;    printf(“Enter the no of memory blocks and processes:”);    scanf(“%d%d”,&a,&c);    int ba,pc;    printf(“Enter memory blocks:”);    for(e=0;e