Implementation of Round-Robin scheduling in C
Program: #include<stdio.h> int main(){ int bt[10],st[10],wt[10],tt[10]; int n,i,j,count=0,quantum,w1=0,t1=0,t,sq=0; float aw=0.0,at=0.0; printf("Enter Number of processes and time quantum:\n"); scanf("%d%d",&n,&quantum); for(i=0;i<n;i++){ printf("Enter burst time for process-%d:\n",i+1); scanf("%d",&bt[i]); st[i]=bt[i]; } // while(true){ for(i=0,count=0;i<n;i++){ t=quantum; if(st[i]==0){ count++; continue; } if(st[i] > quantum){ st[i] = st[i] - quantum; }else{ if(st[i] >= 0){ t = st[i]; st[i]=0; } } sq=sq+t; tt[i]=sq; } if(n == count){ break; } } // for(i=0;i<n;i++){ wt[i] = tt[i] - bt[i]; w1+=wt[i]; t1+=tt[i]; } aw = (float)w1/n; at = (float)t1/n; printf("\nBt\tWt\tTt\n"); for(i=0;i<n;i++){ printf("%d\t%d\t%d\n",bt[i],wt[i],tt[i]); } printf(...