int main()
{int n;//To hold the no. of processes.struct proc p[10],tmp;//To hold the details of the processes.int i,j;printf("Enter the number if processes you want to enter:");scanf("%d",&n);//Get the total no. of processes from tje user

for(i=0;i<n;i++)p[i]=read(i);//Get the details of all the processes

for(i=0;i<n-1;i++)for(j=0;j<n-1-i;j++)//Create the ready queue and update every time a new process is scheduled{if(p[j].arr_time>p[j+1].arr_time)////swap(&p[j],&p[j+1]);{tmp=p[j];p[j]=p[j+1];p[j+1]=tmp;}}for(i=0;i<n;i++)printf("%d ",p[i].no);
getch();// Print the order in which the processes are getting executed.return 0;
}