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;
- printf ("Enter the no. of process: ");
- scanf("%d",&n);
- for(i=0; i<n; i++)
- {
- printf ("Enter burst time for processed %d:",i);
- scanf ("%d", &bt[i]);
- }
- //waiting time & TA time
- wt[0]=0;
- tat[0]=bt[0];
- for(i=1; i<n; i++)
- {
- wt[i]=tat[i-1];
- tat[i]=bt[i]+wt[i];
- }
- printf("\t process \t Bust time \t waiting time \t turnarandT");
- 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