forked from Pranjalmishra30/OSProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
55 lines (45 loc) · 1.28 KB
/
main.c
File metadata and controls
55 lines (45 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include "Algorithms/SJF.c"
#include "Algorithms/fcfs.c"
#include "Algorithms/priorityScheduling.c"
#include "Algorithms/RR.c"
int main(){
int n;
printf("\n-----------------------------\n");
printf("\tOS Project\n");
printf("-----------------------------\n");
while(1){
printf("\nScheduling algorithms\n");
printf("1. FCFS\n");
printf("2. SJF\n");
printf("3. Round Robin\n");
printf("4. Priority Scheduling\n");
printf("Choose option: ");
scanf("%d",&n);
switch (n){
case 1:
printf("\nExecuting FCFS\n");
solveFCFS();
break;
case 2:
printf("\nExecuting SJF....\n\n");
solveSJF();
break;
case 3:
printf("\nExecuting Round Robin\n");
solveRR();
break;
case 4:
printf("\nExecuting Priority Scheduling\n");
solvePri();
break;
case -1:
printf("Exiting...\n");
exit(0);
default:
printf("Wrong option....\n");
}
}
}