Round Robin

9 Comments

C program for Round Robin

C program for Round Robin   #include<stdio.h> #include<conio.h> #include<iostream.h> int t,n,s,bt[10],ct[10],ta[10],w[10],lat[10],wav,taav; int allover() { for(int i=0;i<n;i++) if(ct[i]>0) return 0; return 1; } void select(int p) { w[p]+=t-lat[p]; if(ct[p]>=s) { ct[p]-=s; t+=s; } else { t+=ct[p]; ct[p]=0; } if(ct[p]==0) ta[p]=t; lat[p]=t; } void main() { int p=0;t=0;taav=0;wav=0; clrscr(); printf("Enter the number of process : "); scanf("%d",&n); […]

75 Comments

C program for Round Robin CPU Scheduling Algorithm

INPUT : enter the process name : aaa enter the processing time : 4 enter the process name : bbb enter the processing time : 3 enter the process name : ccc enter the processing time : 2 enter the process name : ddd enter the processing time : 5 enter the process name : […]