Home
Welcome to the world of Computer Science, here you’ll get solutions of your all problems related to computer science. if you have any problem or any coding problem then you can comment and you’ll get the solution by next day for sure.
Please Click on Blog to See recent Posts.
thanks..
Contact
If you have any query then ask here…
Banker’s Safety Algorithm Implementation in C
#include<stdio.h> static int visited[20]; int i,j,np,nr; int safe(int n[10][10],int ar[10],int a[10][10],int m[10][10]); int canbeprocessed(int x[10],int y[10],int z[10],int ar[10]); void additionalrequest(int a1[10][10],int m1[10][10],int ar1[10]); int main() { int a[10][10],m[10][10],n[10][10],ar[10],t[10]; int a1[10][10],m1[10][10],ar1[10]; printf(“\nEnter the no of process: “); scanf(“%d”,&np); printf(“\nEnter the no of resources: “); scanf(“%d”,&nr); for(i=0;i<nr;i++) { printf(“\nTotal Amount of the Resource R%d: “,i+1); scanf(“%d”,&t[i]); }…