Os Programs
Os Programs
#include <bits/stdc++.h>
// in a frame or not
if (fr[i] == key)
return true;
return false;
int j;
if (fr[i] == pg[j]) {
if (j > farthest) {
farthest = j;
res = i;
break;
// return it.
if (j == pn)
return i;
// we return res.
vector<int> fr;
int hit = 0;
for (int i = 0; i < pn; i++) {
if (search(pg[i], fr)) {
hit++;
continue;
fr.push_back(pg[i]);
else {
fr[j] = pg[i];
// Driver Function
int main()
{
int pg[] = { 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2 };
int fn = 4;
return 0;
}
Write a program in for FCS .
#include <bits/stdc++.h>
// in a frame or not
if (fr[i] == key)
return true;
return false;
int j;
if (fr[i] == pg[j]) {
if (j > farthest) {
farthest = j;
res = i;
break;
// return it.
if (j == pn)
return i;
// we return res.
vector<int> fr;
int hit = 0;
for (int i = 0; i < pn; i++) {
if (search(pg[i], fr)) {
hit++;
continue;
fr.push_back(pg[i]);
else {
fr[j] = pg[i];
// Driver Function
int main()
{
int pg[] = { 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2 };
int fn = 4;
return 0;
}
#include<stdio.h>
#include<conio.h>
void main()
{
// initlialize the variable name
int i, NOP, sum=0,count=0, y, quant, wt=0, tat=0, at[10], bt[10], temp[10];
float avg_wt, avg_tat;
printf(" Total number of process in the system: ");
scanf("%d", &NOP);
y = NOP; // Assign the number of process to variable y
12.
// Use for loop to enter the details of the process like Arrival time and the Burst Time
Output
Experiment no – 6
#include<stdio.h>
int main()
int queue[20],n,head,i,j,k,seek=0,max,diff,temp,queue1[20],queue2[20],
temp1=0,temp2=0;
scanf("%d",&temp);
if(temp>=head)
queue1[temp1]=temp;
temp1++;
e
l
queue2[temp2]=temp;
temp2++;
for(i=0;i<temp1-1;i++)
for(j=i+1;j<temp1;j++)
if(queue1[i]>queue1[j])
temp=queue1[i];
queue1[i]=queue1[j];
queue1[j]=temp;
for(i=0;i<temp2-1;i++)
for(j=i+1;j<temp2;j++)
if(queue2[i]>queue2[j])
{
temp=queue2[i];
queue2[i]=queue2[j];
queue2[j]=temp;
for(i=1,j=0;j<temp1;i++,j++)
queue[i]=queue1[j];
queue[i]=max;
queue[i+1]=0;
for(i=temp1+3,j=0;j<temp2;i++,j+
+) queue[i]=queue2[j];
queue[0]=head;
for(j=0;j<=n+1;j++)
diff=abs(queue[j+1]-
queue[j]);
seek+=diff;
avg=seek/(float)n;
n",avg);
return 0;
}
Output
Experiment no- 7
#include<pthread.h>
#include<stdio.h>
#include<semaphore.h>
#include<unistd.h> void
int main()
number of processes sharing semaphore, 3rd argument is the initial value of semaphore variable
void *fun1()
{ int
x;
void *fun2()
{ int
y;
Output
Experiment no-8 Linux
commands
on the terminal clear - Clear the terminal display echo - Print any
paged outputs in the terminal man - Access manual pages for all
lines from the top tail - Return the specified number of lines from
the bottom diff - Find the difference between two files cmp -
Allows you to check if two files are identical comm - Combines the
variables in Linux
zip - Zip files in Linux unzip - Unzip files in Linux ssh - Secure Shell
traceroute - Trace all the network hops to reach the destination wget
iptables - Base firewall for all other firewall utilities to interface with
line calendar alias - Create custom shortcuts for your regularly used
- Locate the binary, source, and manual pages for a command whatis -
Find what a command is used for top - View active processes live with
their system usage useradd and usermod - Add new user or change
users