FCFS ALGORITHM
#include<stdio.h>
void main()
{
int p[10],i,n,total=0;
printf("Enter no of process");
scanf("%d",&n);
printf("Enter burst time");
for(i=0;i<n;i++)
scanf("%d",&p[i]);
printf("\n The process in FCFs are\n ");
printf("PROCESS\tBURST TIME\n");
for(i=0;i<n;i++)
printf("p%d\t\t%d\n",i,p[i]);
printf("T6he total process in FCFS are {");
for(i=0;i<n;i++)
printf("p%d,",i);
printf("}");
for(i=0;i<n;i++)
{
total+=p[i];
}
printf("\n Total Time=%d",total);
}
No comments:
Post a Comment