Académique Documents
Professionnel Documents
Culture Documents
h>
#include<stdlib.h>
#include<time.h>
#define PROCESSES 9
#define NEWLINE '\n'
int main(){
printf("PID \t No. of bursts \t Arrival time \t\t\t Duration \n");
srand(time(NULL));
for(int i = 0; i<=PROCESSES; i++){
printf("%d\t\t",i);
printf("%d\t\t",bursts);
int arrival;
if( i == 0){
arrival = 0;
}else{
arrival = arrival + (rand() % 5);
}
printf("%d\t\t", arrival);
printf("%c",NEWLINE);
}
return(0);
}