i was searching for source code for simulation of CPU Scheduling Algorithm FCFS in C on google
but google had disappointed me.....
so i am going to post it here!
#include < stdio.h>
#include < conio.h>
struct process p;
int i, j, wait=0;
printf("\nenter burst time\n");
printf("\nprocess\t\tburst time\t\twaiting time\n");
printf("\nP%d\t\t%d\t\t\t\t %d",p[i].pid, p[i].burst,p[i].wait);
wait = wait + p[i].burst;
printf("\n\naverage waiting time= %f",(twait/5));
Output for this code looks like this
Post a Comment