Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void main()
- {
- int bt[20], wt[20], tat[20], i, n;
- float wtavg, tatavg, watag;
- printf ("Enter the no. of process: ");
- scanf("%d",&n);
- for(i=0; i<n; i++)
- {
- printf ("Enter burst time for process %d: ", i);
- scanf ("%d", &bt[i]);
- }
- wt[0] = 0;
- tat[0] = bt[0];
- for(i=1; i<n; i++)
- {
- wt[i]=tat[i-1];
- tat[i]= wt[i]+bt[i];
- }
- printf("\t Process \t Burst Time \t Waiting Time \t TurnaroundT");
- for(i=0; i<n; i++)
- {
- printf("\n\t p%d \t\t%d \t\t%d \t\t%d", i, bt[i], wt[i], tat[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement