<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: C program for LRU page replacement algorithm	</title>
	<atom:link href="https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 19 Nov 2015 04:10:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>
		By: Anonymous		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-141732</link>

		<dc:creator><![CDATA[Anonymous]]></dc:creator>
		<pubDate>Thu, 19 Nov 2015 04:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-141732</guid>

					<description><![CDATA[Bruh you ever heard of indenting]]></description>
			<content:encoded><![CDATA[<p>Bruh you ever heard of indenting</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ANJAN MUKHERJEE		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-140246</link>

		<dc:creator><![CDATA[ANJAN MUKHERJEE]]></dc:creator>
		<pubDate>Fri, 06 Nov 2015 21:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-140246</guid>

					<description><![CDATA[#include
#include
#include
#include

using namespace std;

int main()
{
int p[12]={2,3,2,1,5,2,4,5,3,2,5,2},f=3,frame[3]={-1,-1,-1};
int arr[3]={0,0,0},flag=0,pos,counter=1,m;

for(int i=0;i&#060;12;i++)
{   pos=0;
    for(int j=0;j&#060;3;j++)
    {
        if(p[i]==frame[j])
        {
            flag=1;
            pos=j;
        }
    }

    if(flag==1)
    {
        arr[pos]=counter;

    }

    if(flag==0)
    {
        m=arr[0];

        for(int j=0;jarr[j])
            {
                m=arr[j];
                pos=j;
            }
        }

        frame[pos]=p[i];
        arr[pos]=counter;
    }

    counter++;

          cout&#060;&#060;frame[0]&#060;&#060;frame[1]&#060;&#060;frame[2]&#060;&#060;&#034;tt&#034;;
        cout&#060;&#060;arr[0]&#060;&#060;arr[1]&#060;&#060;arr[2]&#060;&#060;&#034;n&#034;;
    flag=0;

}
return 0;

}]]></description>
			<content:encoded><![CDATA[<p>#include<br />
#include<br />
#include<br />
#include</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
int p[12]={2,3,2,1,5,2,4,5,3,2,5,2},f=3,frame[3]={-1,-1,-1};<br />
int arr[3]={0,0,0},flag=0,pos,counter=1,m;</p>
<p>for(int i=0;i&lt;12;i++)<br />
{   pos=0;<br />
    for(int j=0;j&lt;3;j++)<br />
    {<br />
        if(p[i]==frame[j])<br />
        {<br />
            flag=1;<br />
            pos=j;<br />
        }<br />
    }</p>
<p>    if(flag==1)<br />
    {<br />
        arr[pos]=counter;</p>
<p>    }</p>
<p>    if(flag==0)<br />
    {<br />
        m=arr[0];</p>
<p>        for(int j=0;jarr[j])<br />
            {<br />
                m=arr[j];<br />
                pos=j;<br />
            }<br />
        }</p>
<p>        frame[pos]=p[i];<br />
        arr[pos]=counter;<br />
    }</p>
<p>    counter++;</p>
<p>          cout&lt;&lt;frame[0]&lt;&lt;frame[1]&lt;&lt;frame[2]&lt;&lt;&quot;tt&quot;;<br />
        cout&lt;&lt;arr[0]&lt;&lt;arr[1]&lt;&lt;arr[2]&lt;&lt;&quot;n&quot;;<br />
    flag=0;</p>
<p>}<br />
return 0;</p>
<p>}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Abhishek		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-101316</link>

		<dc:creator><![CDATA[Abhishek]]></dc:creator>
		<pubDate>Mon, 04 May 2015 19:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-101316</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-101315&quot;&gt;Abhishek&lt;/a&gt;.

*#include
This program works well.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-101315">Abhishek</a>.</p>
<p>*#include<br />
This program works well.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Abhishek		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-101315</link>

		<dc:creator><![CDATA[Abhishek]]></dc:creator>
		<pubDate>Mon, 04 May 2015 19:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-101315</guid>

					<description><![CDATA[#include
void display(int fr[])
{
	
	
	printf(&quot;\n%d  %d  %d&quot;,fr[0],fr[1],fr[2]);
}

int  main()
{int p[12]={2,3,2,1,5,2,4,5,3,2,5,2};
int i,j;
int flag1,flag2;
int found;
int pf=0;
int fr[3]={-1,-1,-1};

for(i=0;i&#060;12;i++)
{	flag1=0;flag2=0;
for(j=0;j&#060;3;j++)
{
if(fr[j]==p[i])
{flag1=flag2=1;
break;
}}

if(flag1==0)
{
for(j=0;j&#060;3;j++)
	
	if(fr[j]==-1)
	{
		fr[j]=p[i];
		flag2=1;
		pf++;
		break;
		}
		}
		int max,k;
		int l[3]={99,99,99};
		
		if(flag2==0)
		{
			for(j=0;j&#060;3;j++)
			{
				for(k=0;k&#060;i;k++)
				{if(fr[j]==p[k])
					l[j]=k;
				}
				
			}found=0;
			for(j=0;j&#060;3;j++)
			{
			if(l[j]==99)
			{fr[j]=p[i];
			pf++;
			found=1;
		}}
		
		if(found==0)
		{
			max=0;
			for(j=0;j&#060;3;j++)
			if(l[j]&#060;l[max])
			max=j;
			
			fr[max]=p[i];
		pf++;
	}
}
found=0;
	display(fr);
}	printf(&#034;\nNo of Page faults: %d&#034;,pf);
}]]></description>
			<content:encoded><![CDATA[<p>#include<br />
void display(int fr[])<br />
{</p>
<p>	printf(&#8220;\n%d  %d  %d&#8221;,fr[0],fr[1],fr[2]);<br />
}</p>
<p>int  main()<br />
{int p[12]={2,3,2,1,5,2,4,5,3,2,5,2};<br />
int i,j;<br />
int flag1,flag2;<br />
int found;<br />
int pf=0;<br />
int fr[3]={-1,-1,-1};</p>
<p>for(i=0;i&lt;12;i++)<br />
{	flag1=0;flag2=0;<br />
for(j=0;j&lt;3;j++)<br />
{<br />
if(fr[j]==p[i])<br />
{flag1=flag2=1;<br />
break;<br />
}}</p>
<p>if(flag1==0)<br />
{<br />
for(j=0;j&lt;3;j++)</p>
<p>	if(fr[j]==-1)<br />
	{<br />
		fr[j]=p[i];<br />
		flag2=1;<br />
		pf++;<br />
		break;<br />
		}<br />
		}<br />
		int max,k;<br />
		int l[3]={99,99,99};</p>
<p>		if(flag2==0)<br />
		{<br />
			for(j=0;j&lt;3;j++)<br />
			{<br />
				for(k=0;k&lt;i;k++)<br />
				{if(fr[j]==p[k])<br />
					l[j]=k;<br />
				}</p>
<p>			}found=0;<br />
			for(j=0;j&lt;3;j++)<br />
			{<br />
			if(l[j]==99)<br />
			{fr[j]=p[i];<br />
			pf++;<br />
			found=1;<br />
		}}</p>
<p>		if(found==0)<br />
		{<br />
			max=0;<br />
			for(j=0;j&lt;3;j++)<br />
			if(l[j]&lt;l[max])<br />
			max=j;</p>
<p>			fr[max]=p[i];<br />
		pf++;<br />
	}<br />
}<br />
found=0;<br />
	display(fr);<br />
}	printf(&quot;\nNo of Page faults: %d&quot;,pf);<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Banani Medhi		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-70146</link>

		<dc:creator><![CDATA[Banani Medhi]]></dc:creator>
		<pubDate>Mon, 12 Jan 2015 06:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-70146</guid>

					<description><![CDATA[Totally wrong program. If two pages come in continuum, gives wrong output.]]></description>
			<content:encoded><![CDATA[<p>Totally wrong program. If two pages come in continuum, gives wrong output.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: gaju		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-10528</link>

		<dc:creator><![CDATA[gaju]]></dc:creator>
		<pubDate>Sun, 20 Apr 2014 14:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-10528</guid>

					<description><![CDATA[its not bad.......]]></description>
			<content:encoded><![CDATA[<p>its not bad&#8230;&#8230;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lib		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-9814</link>

		<dc:creator><![CDATA[Lib]]></dc:creator>
		<pubDate>Wed, 05 Jun 2013 10:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-9814</guid>

					<description><![CDATA[Hello, can u give the C code for MRU page replement algorithm?. Pls...]]></description>
			<content:encoded><![CDATA[<p>Hello, can u give the C code for MRU page replement algorithm?. Pls&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Well		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-9718</link>

		<dc:creator><![CDATA[Well]]></dc:creator>
		<pubDate>Fri, 19 Apr 2013 19:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-9718</guid>

					<description><![CDATA[@ashita copy paste it]]></description>
			<content:encoded><![CDATA[<p>@ashita copy paste it</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: imran		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-9600</link>

		<dc:creator><![CDATA[imran]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 19:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-9600</guid>

					<description><![CDATA[This program gives wrong output. I guess 7 page faults according to given input.]]></description>
			<content:encoded><![CDATA[<p>This program gives wrong output. I guess 7 page faults according to given input.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Omkar		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-lru-page-replacement-algorithm/comment-page-1/#comment-9590</link>

		<dc:creator><![CDATA[Omkar]]></dc:creator>
		<pubDate>Sun, 10 Mar 2013 10:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=775#comment-9590</guid>

					<description><![CDATA[Hey,its very correct program,but; just need one modification..
if two same elements appear altogether then it results in wrong output.
eg. 1 2 3 2 3 4 5 will give correct output.
but;1 2 3 3 3 4 5 will yield wrong output.
I agree its a very rare case..but;look for it if you can..!!
Thank you..!!]]></description>
			<content:encoded><![CDATA[<p>Hey,its very correct program,but; just need one modification..<br />
if two same elements appear altogether then it results in wrong output.<br />
eg. 1 2 3 2 3 4 5 will give correct output.<br />
but;1 2 3 3 3 4 5 will yield wrong output.<br />
I agree its a very rare case..but;look for it if you can..!!<br />
Thank you..!!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
