Question: #define N 4 int main ( ) { static int pn [ N ] = { 3 , 2 , 1 , 4 } ,
#define N int main static int pnN atN btN; int wtN ttN i j sum ; float avgwt avgtt ; printftFCFS Scheduling Policy
; printf
; printf pnt att btt wtt ttt
; printf
; Calculate waiting time wt; First process has zero waiting time for i ; i N; i wti; for j ; j i; j wti btj; wti ati; if wti wti; No negative waiting time Calculate turnaround time and sum of waitingturnaround times for i ; i N; i tti bti wti; avgwt wti; avgtt tti; printfdtdtdtdtdt
pni ati bti wti tti; printf
; Calculate and display average waiting time and turnaround time avgwt N; avgtt N; printfAverage Waiting Time: f
avgwt; printfAverage Turnaround Time: f
avgtt; return ; do it with Gantt chart
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
