Amit OS Lab 07
Amit OS Lab 07
: 231111062
Course Name : CSE (IoT & CSBC) Course ID : CSL403
Year : SE Semester : IV
Roll No. : 29
Experiment No. : 07
Experiment Name :
MarksPerformance Correction
Sr No. Evaluation Criteria Date & Sign
(Out of 9) Date
of Instructor
1. Experiment Performance
2. Journal Performance
3. Punctuality
Total
Operating System Lab
#include<stdio.h>
int main() {
int p, c, count = 0, i, j, alc[5][3], max[5][3], need[5][3], safe[5],
available[3], done[5], terminate = 0;
printf("Enter the number of process and resources");
scanf("%d %d", & p, & c);
// p is process and c is diffrent resources
printf("enter allocation of resource of all process %dx%d matrix", p,
c); for (i = 0; i < p; i++) {
for (j = 0; j < c; j++) {
scanf("%d", & alc[i][j]);}
}
Amit Mishra Roll No. : 29 Page No. : 02
Operating System Lab
}
if (terminate != (p - 1)) {
printf("\n available resource after completion\
n"); for (i = 0; i < c; i++) {
printf("%d\t", available[i]);
}
printf("\n safe sequence are\n");
for (i = 0; i < p; i++) { printf("p%d\
t", safe[i]);
}
}
return 0;
}
OUTPUT :
CONCLUSION :
Thus, we successfully verified Banker’s Algorithm and performed it
both theoretically and practically.