Computer Programms
Programms and Algorithms
All Programs are Written and Compiled in Dev C++. So, it may generate some error in case of other compilers and may need some modifications in program. Download Dev C++
Wednesday 8 April 2015
Friday 12 December 2014
Least Recently Used Page Replacement Program
AIM: To Implement LRU Page Replacement Program
#include<iostream>using namespace std;
int main()
{
int p[50],fr[10],used[10];
int i,j,k,n,fs,flag=0,pf=0,index;
cout<<"Enter no of Refrence Strings: ";
cin>>n;
cout<<"Enter Refrence Strings: ";
for(i=0;i<n;i++)
cin>>p[i];
cout<<"Enter Frame Size: ";
cin>>fs;
Implement MVT with First Fit Memory Management Technique
AIM: Implement MVT with No of Partititon and Apply First Fit Memory Management.
#include<iostream>
using namespace std;
int main()
{
int tm,rm,os,n,i,ps,pn,pt[10],pt1[10];
int fra1,fra2,tf=0,tp=0,flag=0,c=0;
cout<<"Enter Total Memory: ";
cin>>tm;
cout<<"Enter Memory Given to OS: ";
cin>>os;
rm=tm-os;
cout<<"Enter No of Partiotion: ";
cin>>pn;
cout<<"Enter The Size for Each Partition\n";
for(i=0;i<pn;i++)
{
cout<<"\nPartition"<<i+1<<": ";
cin>>pt1[i];
if(tp+pt1[i]<rm)
{
#include<iostream>
using namespace std;
int main()
{
int tm,rm,os,n,i,ps,pn,pt[10],pt1[10];
int fra1,fra2,tf=0,tp=0,flag=0,c=0;
cout<<"Enter Total Memory: ";
cin>>tm;
cout<<"Enter Memory Given to OS: ";
cin>>os;
rm=tm-os;
cout<<"Enter No of Partiotion: ";
cin>>pn;
cout<<"Enter The Size for Each Partition\n";
for(i=0;i<pn;i++)
{
cout<<"\nPartition"<<i+1<<": ";
cin>>pt1[i];
if(tp+pt1[i]<rm)
{
Tuesday 28 October 2014
LRU Page Replacement Program
LRU Page Replacement Program
#include<iostream>using namespace std;
int main()
{
int p[50],q[20],b[20],c2[20];
int c=0,k=0,c1,d,f,i,j,n,r,t;
cout<<"Enter no of pages:";
cin>>n;
cout<<"Enter the reference string:";
for(i=0;i<n;i++)
cin>>p[i];
cout<<"Enter no of frames:";
cin>>f;
q[k]=p[k];
cout<<"\n\t"<<q[k]<<endl;
c++;
k++;
for(i=1;i<n;i++)
{
c1=0;
for(j=0;j<f;j++)
{
Subscribe to:
Posts (Atom)