Monthly Archives: April 2014

C PROGRAM FOR NON PREEMPTIVE SHORTEST JOB FIRST SCHEDULING

  #include<stdio.h> typedef struct nonpresjf { int at,bt,ft,tat,wt; }nonpresjf; nonpresjf p[20],p1[20]; int main() { int i,limit,nextval,m,min,n; p[0].wt=p[0].tat=0; printf(“\nEnter the no of process: “); scanf(“%d”,&n); for(i=1;i<=n;i++) { printf(“Enter the arrival time: “); scanf(“%d”,&p[i].at); } limit=p[1].at; for(i=1;i<=n;i++) { printf(“Enter the burst time: “); scanf(“%d”,&p[i].bt); } for(i=1;i<=n;i++) limit+=p[i].bt; for(i=1;i<=n;i++) p1[i]=p[i]; printf(“\n\nGantt chart is as follows: “); printf(“%d”,p[1].at); nextval=p[1].at;… Read More »

C PROGRAM FOR PRODUCER CONSUMER PROBLEM

NOTE: To Execute the following program you need to type the given below command  in to the terminal gcc filename.c -lpthread REASON: “The header pthread.h is used so that the compiler understands the data types & symbol names, which are used in the below given C program but are defined/declared in the pthread library header file.   pthread libray is linked using -lpthread ,so that… Read More »

CPP PROGRAM FOR ROUND ROBIN SCHEDULING ALGORITHM

Note: The following program is written in cpp under linux environment if you are using terminal to compile, then use g++ instead of gcc or cc .if any problem arises or you have any doubt then feel free to leave comments. #include<iostream> #include<cstdlib> #include<queue> #include<cstdio> using namespace std;typedef struct process { int ProcessID,ArrivalTime,BurstTime,StratTime,FinishTime,Priority; float WaitTime,TurnArroundTime; }process;… Read More »

C PROGRAM FOR READER WRITER PROBLEM

NOTE: To Execute the following program you need to type the given below command  in to the terminal                                         gcc filename.c -lpthread   REASON: “The header pthread.h is used so that the compiler understands the data types & symbol names, which are used… Read More »

HOW TO Delete Undeletable Files Easily

Sometimes it is not possible to delete files and folders in Windows OS. It is common now-a-days. You will get prompts like “This program is in use” or anything similar to that. You can delete those files and folders easily by using Safe Mode with Command Prompt. I tried it and I was successful. Make… Read More »

C PROGRAM FOR BANKER’S ALGORITHM TO AVOID DEADLOCK

Note: The below written code is in C and can be executed using gcc  #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… Read More »

SOFTWARE LABORATORY PROGRAMS

    As this is the Exam Time so i am giving you all the software laboratory programs which will be helpful for you for the Practical Exam Preparation.    You can download these programs from the following Link :                             DOWNLOAD SOFTWARE… Read More »