<?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 Priority Scheduling</title>
	<atom:link href="http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/feed/" rel="self" type="application/rss+xml" />
	<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/</link>
	<description>...bringing innovative minds together</description>
	<lastBuildDate>Thu, 09 Feb 2012 18:55:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.6</generator>
	<item>
		<title>By: rani</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6771</link>
		<dc:creator>rani</dc:creator>
		<pubDate>Tue, 31 Jan 2012 09:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6771</guid>
		<description>// non preemitive algorithm


#include
#include
	void main()
	{
		int n,p[10],b[10],i,j,temp,temp1,pr[10],q[10];
		float c,s=0.0;
		clrscr();
		printf(“Enter the no. of process\n”);
		scanf(“%d”,&amp;n);
		printf(“Enter processes\n”);
		for(i=0;i&lt;n;i++)
		{
			scanf(&quot;%d&quot;,&amp;p[i]);
		}
		printf(&quot;Enter brust time\n&quot;);
		for(i=0;i&lt;n;i++)
		{
			scanf(&quot;%d&quot;,&amp;b[i]);
		}
		printf(&quot;Enter the priority\n&quot;);
		for(i=0;i&lt;n;i++)
		{
			scanf(&quot;%d&quot;,&amp;pr[i]);
		}
		for(i=0;i&lt;n;i++)
		{
			for(j=1;j&lt;n;j++)
			{
				temp=pr[i];
				temp1=p[i];
				pr[i]=pr[j];
				p[i]=p[j];
				pr[j]=temp;
				p[j]=temp1;
			}
		}
		for(i=0;i&lt;n;i++)
		{
			printf(&quot;process is %d and it&#039;s Priority is %d\n&quot;,p[i],pr[i]);
		}
		p[0]=0;
		for(i=0;i&lt;n;i++)
		{
			p[i+1]=p[i]+b[i];
			printf(&quot;Waiting time=%d\n&quot;,p[i]);
		}
		for(i=0;i&lt;n;i++)
		{
			s=s+p[i];
		}
		c=s/n;
		printf(&quot;Average waiting time=%f&quot;,c);
		getch();
	}</description>
		<content:encoded><![CDATA[<p>// non preemitive algorithm</p>
<p>#include<br />
#include<br />
	void main()<br />
	{<br />
		int n,p[10],b[10],i,j,temp,temp1,pr[10],q[10];<br />
		float c,s=0.0;<br />
		clrscr();<br />
		printf(“Enter the no. of process\n”);<br />
		scanf(“%d”,&amp;n);<br />
		printf(“Enter processes\n”);<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			scanf(&quot;%d&quot;,&amp;p[i]);<br />
		}<br />
		printf(&quot;Enter brust time\n&quot;);<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			scanf(&quot;%d&quot;,&amp;b[i]);<br />
		}<br />
		printf(&quot;Enter the priority\n&quot;);<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			scanf(&quot;%d&quot;,&amp;pr[i]);<br />
		}<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			for(j=1;j&lt;n;j++)<br />
			{<br />
				temp=pr[i];<br />
				temp1=p[i];<br />
				pr[i]=pr[j];<br />
				p[i]=p[j];<br />
				pr[j]=temp;<br />
				p[j]=temp1;<br />
			}<br />
		}<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			printf(&quot;process is %d and it&#039;s Priority is %d\n&quot;,p[i],pr[i]);<br />
		}<br />
		p[0]=0;<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			p[i+1]=p[i]+b[i];<br />
			printf(&quot;Waiting time=%d\n&quot;,p[i]);<br />
		}<br />
		for(i=0;i&lt;n;i++)<br />
		{<br />
			s=s+p[i];<br />
		}<br />
		c=s/n;<br />
		printf(&quot;Average waiting time=%f&quot;,c);<br />
		getch();<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaya pandey</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6716</link>
		<dc:creator>jaya pandey</dc:creator>
		<pubDate>Wed, 25 Jan 2012 09:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6716</guid>
		<description>kal mera birthday hai........</description>
		<content:encoded><![CDATA[<p>kal mera birthday hai&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anish kamadana</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6604</link>
		<dc:creator>anish kamadana</dc:creator>
		<pubDate>Mon, 09 Jan 2012 10:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6604</guid>
		<description>chaaaaaaaa</description>
		<content:encoded><![CDATA[<p>chaaaaaaaa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: honey</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6459</link>
		<dc:creator>honey</dc:creator>
		<pubDate>Wed, 21 Dec 2011 17:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6459</guid>
		<description>i want simple code for sjf preemptive</description>
		<content:encoded><![CDATA[<p>i want simple code for sjf preemptive</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randhir Singh</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6296</link>
		<dc:creator>Randhir Singh</dc:creator>
		<pubDate>Wed, 30 Nov 2011 18:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6296</guid>
		<description>#include
#include
void main()
{
int n,p[10],b[10],i,j,temp,temp1,pr[10],q[10];
float c,s=0.0;
clrscr();
printf(&quot;Enter the no. of process\n&quot;);
scanf(&quot;%d&quot;,&amp;n);
printf(&quot;Enter processes\n&quot;);
for(i=0;i&lt;n;i++)
{
scanf(&quot;%d&quot;,&amp;p[i]);
}
printf(&quot;Enter brust time\n&quot;);
for(i=0;i&lt;n;i++)
{
scanf(&quot;%d&quot;,&amp;b[i]);
}
printf(&quot;Enter the priority\n&quot;);
for(i=0;i&lt;n;i++)
{
scanf(&quot;%d&quot;,&amp;pr[i]);
}
for(i=0;i&lt;n;i++)
{
for(j=1;j&lt;n;j++)
{
temp=pr[i];
temp1=p[i];
pr[i]=pr[j];
p[i]=p[j];
pr[j]=temp;
p[j]=temp1;
}
}
for(i=0;i&lt;n;i++)
{
printf(&quot;process is %d and it&#039;s Priority is %d\n&quot;,p[i],pr[i]);
}
p[0]=0;
for(i=0;i&lt;n;i++)
{
p[i+1]=p[i]+b[i];
printf(&quot;Waiting time=%d\n&quot;,p[i]);
}
for(i=0;i&lt;n;i++)
{
s=s+p[i];
}
c=s/n;
printf(&quot;Average waiting time=%f&quot;,c);
getch();</description>
		<content:encoded><![CDATA[<p>#include<br />
#include<br />
void main()<br />
{<br />
int n,p[10],b[10],i,j,temp,temp1,pr[10],q[10];<br />
float c,s=0.0;<br />
clrscr();<br />
printf(&#8220;Enter the no. of process\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;n);<br />
printf(&#8220;Enter processes\n&#8221;);<br />
for(i=0;i&lt;n;i++)<br />
{<br />
scanf(&quot;%d&quot;,&amp;p[i]);<br />
}<br />
printf(&quot;Enter brust time\n&quot;);<br />
for(i=0;i&lt;n;i++)<br />
{<br />
scanf(&quot;%d&quot;,&amp;b[i]);<br />
}<br />
printf(&quot;Enter the priority\n&quot;);<br />
for(i=0;i&lt;n;i++)<br />
{<br />
scanf(&quot;%d&quot;,&amp;pr[i]);<br />
}<br />
for(i=0;i&lt;n;i++)<br />
{<br />
for(j=1;j&lt;n;j++)<br />
{<br />
temp=pr[i];<br />
temp1=p[i];<br />
pr[i]=pr[j];<br />
p[i]=p[j];<br />
pr[j]=temp;<br />
p[j]=temp1;<br />
}<br />
}<br />
for(i=0;i&lt;n;i++)<br />
{<br />
printf(&quot;process is %d and it&#039;s Priority is %d\n&quot;,p[i],pr[i]);<br />
}<br />
p[0]=0;<br />
for(i=0;i&lt;n;i++)<br />
{<br />
p[i+1]=p[i]+b[i];<br />
printf(&quot;Waiting time=%d\n&quot;,p[i]);<br />
}<br />
for(i=0;i&lt;n;i++)<br />
{<br />
s=s+p[i];<br />
}<br />
c=s/n;<br />
printf(&quot;Average waiting time=%f&quot;,c);<br />
getch();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadab</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6286</link>
		<dc:creator>shadab</dc:creator>
		<pubDate>Mon, 28 Nov 2011 12:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6286</guid>
		<description>sir,
i want a program for priority scheduling by which we can solve response time also.
i want it asap...its really urgent.
if smebody knws please post it or send me a copy to my ,ail.</description>
		<content:encoded><![CDATA[<p>sir,<br />
i want a program for priority scheduling by which we can solve response time also.<br />
i want it asap&#8230;its really urgent.<br />
if smebody knws please post it or send me a copy to my ,ail.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anagh Vijayvargia</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6267</link>
		<dc:creator>Anagh Vijayvargia</dc:creator>
		<pubDate>Thu, 24 Nov 2011 15:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6267</guid>
		<description>/*The correct one is this for priority cpu sheduling
by :anaghvj*/
#include
#include
#include
void main()
{
int temp1,n,p[10],pp[10],pt[10],w[10],t[10],awt,atat,i,j;
clrscr();
printf(&quot;Enter the number of process :&quot; );
scanf(&quot;%d&quot;,&amp;n);
printf(&quot;\n Enter process &amp;: time priorities \n&quot;);
for(i=0;i&lt;n;i++)
{
printf(&quot;\nProcess no %d : &quot;,i+1);
scanf(&quot;%d %d&quot;,&amp;pt[i],&amp;pp[i]);
p[i]=i+1;
}
for(i=0;i&lt;n-1;i++)
{
for(j=i+1;jpp[j])
{
temp1=pp[i];
pp[i]=pp[j];
pp[j]=temp1;
temp1=pt[i];
pt[i]=pt[j];
pt[j]=temp1;
temp1=p[i];
p[i]=p[j];
p[j]=temp1;
}
}
}
w[0]=0;
awt=0;
t[0]=pt[0];
atat=t[0];
for(i=1;i&lt;n;i++)
{
w[i]=t[i-1];
awt+=w[i];
t[i]=w[i]+pt[i];
atat+=t[i];
}
printf(&quot;\n\n Job \t Burst Time \t Wait Time \t Turn Around Time Priority \n&quot;);
for(i=0;i&lt;n;i++)
printf(&quot;\n %d \t\t %d \t\t %d \t\t %d \t\t %d \n&quot;,p[i],pt[i],w[i],t[i],pp[i]);
awt/=n;
atat/=n;
printf(&quot;\n Average Wait Time : %d \n&quot;,awt);
printf(&quot;\n Average Turn Around Time : %d \n&quot;,atat);
getch();
}</description>
		<content:encoded><![CDATA[<p>/*The correct one is this for priority cpu sheduling<br />
by :anaghvj*/<br />
#include<br />
#include<br />
#include<br />
void main()<br />
{<br />
int temp1,n,p[10],pp[10],pt[10],w[10],t[10],awt,atat,i,j;<br />
clrscr();<br />
printf(&#8220;Enter the number of process :&#8221; );<br />
scanf(&#8220;%d&#8221;,&amp;n);<br />
printf(&#8220;\n Enter process &amp;: time priorities \n&#8221;);<br />
for(i=0;i&lt;n;i++)<br />
{<br />
printf(&quot;\nProcess no %d : &quot;,i+1);<br />
scanf(&quot;%d %d&quot;,&amp;pt[i],&amp;pp[i]);<br />
p[i]=i+1;<br />
}<br />
for(i=0;i&lt;n-1;i++)<br />
{<br />
for(j=i+1;jpp[j])<br />
{<br />
temp1=pp[i];<br />
pp[i]=pp[j];<br />
pp[j]=temp1;<br />
temp1=pt[i];<br />
pt[i]=pt[j];<br />
pt[j]=temp1;<br />
temp1=p[i];<br />
p[i]=p[j];<br />
p[j]=temp1;<br />
}<br />
}<br />
}<br />
w[0]=0;<br />
awt=0;<br />
t[0]=pt[0];<br />
atat=t[0];<br />
for(i=1;i&lt;n;i++)<br />
{<br />
w[i]=t[i-1];<br />
awt+=w[i];<br />
t[i]=w[i]+pt[i];<br />
atat+=t[i];<br />
}<br />
printf(&quot;\n\n Job \t Burst Time \t Wait Time \t Turn Around Time Priority \n&quot;);<br />
for(i=0;i&lt;n;i++)<br />
printf(&quot;\n %d \t\t %d \t\t %d \t\t %d \t\t %d \n&quot;,p[i],pt[i],w[i],t[i],pp[i]);<br />
awt/=n;<br />
atat/=n;<br />
printf(&quot;\n Average Wait Time : %d \n&quot;,awt);<br />
printf(&quot;\n Average Turn Around Time : %d \n&quot;,atat);<br />
getch();<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: praneetha</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-6078</link>
		<dc:creator>praneetha</dc:creator>
		<pubDate>Sat, 22 Oct 2011 12:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-6078</guid>
		<description>I need a easy implementation of LRU(least recently used) page replacement algorithm</description>
		<content:encoded><![CDATA[<p>I need a easy implementation of LRU(least recently used) page replacement algorithm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shanu</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-5892</link>
		<dc:creator>shanu</dc:creator>
		<pubDate>Mon, 26 Sep 2011 10:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-5892</guid>
		<description>we need fcfs sjf round robin n priority scheduling pgm tat should be v simple......make it as earlier as possible..................pls</description>
		<content:encoded><![CDATA[<p>we need fcfs sjf round robin n priority scheduling pgm tat should be v simple&#8230;&#8230;make it as earlier as possible&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;pls</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prasad koranne</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/comment-page-1/#comment-5820</link>
		<dc:creator>Prasad koranne</dc:creator>
		<pubDate>Tue, 20 Sep 2011 10:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=1122#comment-5820</guid>
		<description>hi thank u for giving me your code 
i m from MIT college aurangabad 
this is an re-designed code for the Priority job scheduling program using the C language





#include
#include
void main()
 {

   int x,n,p[10],pp[10],pt[10],w[10],t[10],awt,att,i,j;
   clrscr();
   printf(&quot;Enter the number of process : &quot;);
   scanf(&quot;%d&quot;,&amp;n);

   for(i=0;i&lt;n;i++)
    {
      printf(&quot;\nProcess no %d : &quot;,i+1);
      scanf(&quot;%d&quot; ,&amp;pt[i]);
      printf(&quot;\ntime priorities :&quot;);
      scanf(&quot;%d&quot;,&amp;pp[i]);
      p[i]=i+1;
    }
  for(i=0;i&lt;n-1;i++)
   {
     for(j=i+1;j&lt;n;j++)
     {
       if(pp[i]&lt;pp[j])
       {
	 x=pp[i];
	 pp[i]=pp[j];
	 pp[j]=x;
	 x=pt[i];
	 pt[i]=pt[j];
	 pt[j]=x;
	 x=p[i];
	 p[i]=p[j];
	 p[j]=x;
      }
   }
}
w[0]=0;
awt=0;
t[0]=pt[0];
att=t[0];
for(i=1;i&lt;n;i++)
 {
   w[i]=t[i-1];
   awt+=w[i];
   t[i]=w[i]+pt[i];
   att+=t[i];
 }
printf(&quot;\n\n Job \t Burst Time \t Wait Time \t Turn Around Time   Priority \n&quot;);
for(i=0;i&lt;n;i++)
  printf(&quot;\n %d \t\t %d  \t\t %d \t\t %d \t\t %d \n&quot;,p[i],pt[i],w[i],t[i],pp[i]);
awt/=n;
att/=n;
printf(&quot;\n Average Wait Time : %d \n&quot;,awt);
printf(&quot;\n Average Turn Around Time : %d \n&quot;,att);
getch();
}</description>
		<content:encoded><![CDATA[<p>hi thank u for giving me your code<br />
i m from MIT college aurangabad<br />
this is an re-designed code for the Priority job scheduling program using the C language</p>
<p>#include<br />
#include<br />
void main()<br />
 {</p>
<p>   int x,n,p[10],pp[10],pt[10],w[10],t[10],awt,att,i,j;<br />
   clrscr();<br />
   printf(&#8220;Enter the number of process : &#8220;);<br />
   scanf(&#8220;%d&#8221;,&amp;n);</p>
<p>   for(i=0;i&lt;n;i++)<br />
    {<br />
      printf(&quot;\nProcess no %d : &quot;,i+1);<br />
      scanf(&quot;%d&quot; ,&amp;pt[i]);<br />
      printf(&quot;\ntime priorities :&quot;);<br />
      scanf(&quot;%d&quot;,&amp;pp[i]);<br />
      p[i]=i+1;<br />
    }<br />
  for(i=0;i&lt;n-1;i++)<br />
   {<br />
     for(j=i+1;j&lt;n;j++)<br />
     {<br />
       if(pp[i]&lt;pp[j])<br />
       {<br />
	 x=pp[i];<br />
	 pp[i]=pp[j];<br />
	 pp[j]=x;<br />
	 x=pt[i];<br />
	 pt[i]=pt[j];<br />
	 pt[j]=x;<br />
	 x=p[i];<br />
	 p[i]=p[j];<br />
	 p[j]=x;<br />
      }<br />
   }<br />
}<br />
w[0]=0;<br />
awt=0;<br />
t[0]=pt[0];<br />
att=t[0];<br />
for(i=1;i&lt;n;i++)<br />
 {<br />
   w[i]=t[i-1];<br />
   awt+=w[i];<br />
   t[i]=w[i]+pt[i];<br />
   att+=t[i];<br />
 }<br />
printf(&quot;\n\n Job \t Burst Time \t Wait Time \t Turn Around Time   Priority \n&quot;);<br />
for(i=0;i&lt;n;i++)<br />
  printf(&quot;\n %d \t\t %d  \t\t %d \t\t %d \t\t %d \n&quot;,p[i],pt[i],w[i],t[i],pp[i]);<br />
awt/=n;<br />
att/=n;<br />
printf(&quot;\n Average Wait Time : %d \n&quot;,awt);<br />
printf(&quot;\n Average Turn Around Time : %d \n&quot;,att);<br />
getch();<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

