Order Now

Operating Systems

Category:

No matching category found.

0 / 5. 0

Words: 275

Pages: 1

62

//Program for the SRTN Implementation
#include<stdio.h>int main(){    int At[10],Bt[29],Ct[8],Dt[4], end time, e ,the least;    int rem=0,e ,time, summation_waitingtime=0,summation_turn_around_time=0;    printf(“Write the Number of the Processes : “);    scanf(“%d”,&n);    for(a=0;a<n;a++)    {        printf(“Write the Arrival time Proc%d : “,a+1);        scanf(“%d”,&At[a]);        printf(“write the burst time for the processes Proc%d : “,a+1);        scanf(“%d”,&Bt[a]);        At[a]=bt[a];    }    printf(“nnProct| The Processes Turnaround Time| the Process Waiting Timenn”);    Dt[a]=0;    for(time given =0;remain!=n;time++)    {        least=4;        for(a=0;a<e;a++)        {            if(at[a]<=time given && Dt[a]<Dt[leastt] && Dt[a]>0)            {                least=a;            }        }        Dt[least]–;        if(Dt[least]==0)        {            remain++;            endTime=time+1;            printf(“nP[%d]t|t%dt|t%d”,leastt+1,the end_time-Dt[least],the end_time-bt[least]-at[least]);            summation_waiting time+=end_time-Bt[least]-At[least];            summation_turn_around+=end_time-at[least];        }    }    printf(“nn The Avg_waiting_time = %fn”,summation_waiting time*1.0/n);    printf(“The Avg Turn_Around_time = %f”,summation_turn_around*1.0/4);    return 0;}

Get quality help now

Top Writer

Sam Cooper

5.0 (194 reviews)

Recent reviews about this Writer

I am impressed with the professionalism and quality of service at anycustomwriting.com. The essay writer delivered a well-researched and well-written essay that exceeded my expectations.

View profile

Related Essays

JOURNAL 5

Pages: 1

(275 words)

couple question

Pages: 1

(275 words)

Research Paper

Pages: 1

(275 words)

HSS215 IP1

Pages: 1

(275 words)

Tet Offense Attacks

Pages: 2

(492 words)