Calculate and print turnaround time of each process = bt + wt.ĩ. Print Process Id, Burst Time, waiting time and Turnaround time of each process in tabular manner.Ĩ. Calculate waiting time of each process by using two loops and adding all the burst time of previously completed processes.ħ. Assign waiting time = 0 to the smallest process.Ħ. Sort all the processes according to their burst time.ĥ. Ask the user for process id and burst time for all n processes and store them into pid and bt respectively.Ĥ. Ask the user for number of processes n.ģ. Initialize two array pid and bt of size 20.Ģ. printf ( " \nAverage Turnaround Time=%f" ,avg_tat ) ġ.printf ( " \n \nAverage Waiting Time=%f" ,avg_wt ).printf ( " \np%d \t \t %d \t \t %d \t \t \t%d" ,p ,bt ,wt ,tat ).//turnaround time of individual processes.printf ( " \nProcess \t Burst Time \tWaiting Time \tTurnaround Time" ).//individual WT by adding BT of all previous completed processes.//finding the waiting time of all the processes.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |