First_Come_First_Serve CPU Scheduling
#include<stdio.h> #include<conio.h> struct proc { int id; int burst; int at; }; int main() { int n,i,j,total_waiting_time,waiting_time; printf("Enter the number of processess: "); scanf("%d",&n); struct proc p[n],temp; f or(i=0;i<n;i++) { p[i].id=i; printf("Enter the arrival time of the process: "); scanf("%d",&p[i].at); printf("Enter the burst time of the process: "); scanf("%d",&p[i].burst); } for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(p[j].at<p[i].at) { ...
Comments
Post a Comment