Category Archives: Operating System Practicals using C++ Programming

Create Linux ls command C Program

Create Linux ls command C Program – Write a C program under Windows Operating System to create or simulate linux ls command.   Program code #include<stdio.h> #include<dirent.h> int main(int argc, char **argv) { DIR *dp; struct dirent *link; dp=opendir(argv[1]); printf(“\n contents of the directory %s are \n”, argv[1]); while((link=readdir(dp))!=0) printf(“%s\n”,link->d_name); closedir(dp); } Output contents of… Read More »

Loading

SJF Scheduling Algorithm Program Operating System LAB

SJF Scheduling Algorithm Program – Operating System Practicals LAB. Write a C Program to input burst times of N processes and find the Waiting times and Turn around times using SJF – Shortest Job First Scheduling Method in Operating system. Program Code #include<stdio.h> int main() { int bt[20],p[20],wt[20],tat[20],i,j,n,total=0,pos,temp; float avg_wt,avg_tat; printf(“Enter number of process:”); scanf(“%d”,&n);… Read More »

Loading

FCFS Scheduling Algorithm Program in C++

FCFS Scheduling Algorithm Program in C++ : Write a C++ Program To Calculate Average Waiting Time and Average Turn Around Time using FCFS. Program Code: FCFS Scheduling Algorithm Program in C++ We shall use the loop concept and the use of arrays to solve this programming assignment. First of all we will define some variables… Read More »

Loading