<?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="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Tue, 10 Mar 2015 04:13:54 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>
		By: Vishakha		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-87583</link>

		<dc:creator><![CDATA[Vishakha]]></dc:creator>
		<pubDate>Tue, 10 Mar 2015 04:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-87583</guid>

					<description><![CDATA[can you please give me the code for non preemptive priority scheduling??]]></description>
			<content:encoded><![CDATA[<p>can you please give me the code for non preemptive priority scheduling??</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: rizwan		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-87255</link>

		<dc:creator><![CDATA[rizwan]]></dc:creator>
		<pubDate>Mon, 09 Mar 2015 04:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-87255</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10403&quot;&gt;humaira&lt;/a&gt;.

#include
main()
{int n,i,j,at[10],bt[10],p[10],temp,T,st[10],tat[10],wt[10],S,TBT=0,exe[25],k,BT[10],ft[10];float awt=0.0,atat=0.0;
//---------Reading values---------------
printf(&quot;enter the number of process\n&quot;);   
scanf(&quot;%d&quot;,&#038;n);                //Accept number of process
//--Initializing------------------------
for(i=0;i&#060;n;i++)
    {p[i]=-1;
    at[i]=-1;
    bt[i]=-1;
    st[i]=-1;
    wt[i]=0;
    tat[i]=0;}
//----------------------------------------------
printf(&#034;enter the arrival time &#038; burst time for each process \n&#034;);
for(i=0;i&#060;n;i++)
    {printf(&#034;process%d: \n&#034;,i);p[i]=i;
    printf(&#034;    arrival time:&#034;);scanf(&#034;%d&#034;,&#038;at[i]);//Read the arrival time for each process.
    printf(&#034;    burst time:&#034;);scanf(&#034;%d&#034;,&#038;bt[i]); BT[i]=bt[i]; //Read the burst time for each process.
    }
printf(&#034;\n enter the time slot:&#034;);scanf(&#034;%d&#034;,&#038;T); //Accepts the time slot to be given.
//-------Sorting according to arrival time---
for(i=0;i&#060;n;i++)
 for(j=0;jat[j+1])
        {temp=p[j];p[j]=p[j+1];p[j+1]=temp;
        temp=at[j];at[j]=at[j+1];at[j+1]=temp;
        temp=bt[j];bt[j]=bt[j+1];bt[j+1]=temp;
        temp=BT[j];BT[j]=BT[j+1];BT[j+1]=temp;
        }
    }
//-------Printing process after sorting according to at-------
for(i=0;i%d -&#062;%d&quot;,p[i],at[i],bt[i]);
    }
S=at[0]; //S=arrival time of first process.
//---------Calculating the total burst time-------------
for(i=0;i&#060;n;i++)
    TBT=bt[i]+TBT;
printf(&#034;\n Total Burst Time(TBT)=%d \n&#034;,TBT);
//-----Scheduling the process-----------
k=0;
printf(&#034;Scheduling......\n&#034;);
i=0;
while(S&#060;TBT)
{printf(&#034;\nS=%d&#034;,S);
 
    if((at[i]=T)
                {bt[i]=bt[i]-T;S=S+T;ft[i]=S;printf(&quot;    FT=%d&quot;,S);printf(&quot;    rBT=%d&quot;,bt[i]);}
            else
                {S=S+bt[i];bt[i]=0;ft[i]=S;printf(&quot;    FT=%d&quot;,S);printf(&quot;    rBT=%d&quot;,bt[i]);}

        }
if(i=n)i=0;
   
}//while
printf(&quot;\n process execution order:\n&quot;);
for(i=0;i&#060;k;i++)
printf(&#034;%d,&#034;,exe[i]);
//for(i=0;i FT=%d,&quot;,p[i],ft[i]);
//or(i=0;i ST=%d,&quot;,p[i],st[i]);
for(i=0;i&#060;n;i++)
tat[i]=ft[i]-at[i];
for(i=0;i&#060;n;i++)
wt[i]=tat[i]-BT[i];
//--------CALCULATING AV.WT &#038; AV.TAT-----
for(i=0;i&#060;n;i++)
{atat=atat+tat[i];awt=awt+wt[i];
}
atat=atat/n;
awt=awt/n;
//-------------DISPLAY--------------
printf(&#034;\n&#034;);
printf(&#034;process   start time    wait time    turn around time    finish time    burst time\n&#034;);
for(i=0;i&#060;n;i++)
printf(&#034;process %d     %d           %d            %d                 %d        %d\n&#034;,p[i],st[i],wt[i],tat[i],ft[i],BT[i]);
printf(&#034;average wait time=%f \naverage turn around time=%f \n&#034;,awt,atat);

}//main]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10403">humaira</a>.</p>
<p>#include<br />
main()<br />
{int n,i,j,at[10],bt[10],p[10],temp,T,st[10],tat[10],wt[10],S,TBT=0,exe[25],k,BT[10],ft[10];float awt=0.0,atat=0.0;<br />
//&#8212;&#8212;&#8212;Reading values&#8212;&#8212;&#8212;&#8212;&#8212;<br />
printf(&#8220;enter the number of process\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;n);                //Accept number of process<br />
//&#8211;Initializing&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
for(i=0;i&lt;n;i++)<br />
    {p[i]=-1;<br />
    at[i]=-1;<br />
    bt[i]=-1;<br />
    st[i]=-1;<br />
    wt[i]=0;<br />
    tat[i]=0;}<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
printf(&quot;enter the arrival time &amp; burst time for each process \n&quot;);<br />
for(i=0;i&lt;n;i++)<br />
    {printf(&quot;process%d: \n&quot;,i);p[i]=i;<br />
    printf(&quot;    arrival time:&quot;);scanf(&quot;%d&quot;,&amp;at[i]);//Read the arrival time for each process.<br />
    printf(&quot;    burst time:&quot;);scanf(&quot;%d&quot;,&amp;bt[i]); BT[i]=bt[i]; //Read the burst time for each process.<br />
    }<br />
printf(&quot;\n enter the time slot:&quot;);scanf(&quot;%d&quot;,&amp;T); //Accepts the time slot to be given.<br />
//&#8212;&#8212;-Sorting according to arrival time&#8212;<br />
for(i=0;i&lt;n;i++)<br />
 for(j=0;jat[j+1])<br />
        {temp=p[j];p[j]=p[j+1];p[j+1]=temp;<br />
        temp=at[j];at[j]=at[j+1];at[j+1]=temp;<br />
        temp=bt[j];bt[j]=bt[j+1];bt[j+1]=temp;<br />
        temp=BT[j];BT[j]=BT[j+1];BT[j+1]=temp;<br />
        }<br />
    }<br />
//&#8212;&#8212;-Printing process after sorting according to at&#8212;&#8212;-<br />
for(i=0;i%d -&gt;%d&#8221;,p[i],at[i],bt[i]);<br />
    }<br />
S=at[0]; //S=arrival time of first process.<br />
//&#8212;&#8212;&#8212;Calculating the total burst time&#8212;&#8212;&#8212;&#8212;-<br />
for(i=0;i&lt;n;i++)<br />
    TBT=bt[i]+TBT;<br />
printf(&quot;\n Total Burst Time(TBT)=%d \n&quot;,TBT);<br />
//&#8212;&#8211;Scheduling the process&#8212;&#8212;&#8212;&#8211;<br />
k=0;<br />
printf(&quot;Scheduling&#8230;&#8230;\n&quot;);<br />
i=0;<br />
while(S&lt;TBT)<br />
{printf(&quot;\nS=%d&quot;,S);</p>
<p>    if((at[i]=T)<br />
                {bt[i]=bt[i]-T;S=S+T;ft[i]=S;printf(&#8221;    FT=%d&#8221;,S);printf(&#8221;    rBT=%d&#8221;,bt[i]);}<br />
            else<br />
                {S=S+bt[i];bt[i]=0;ft[i]=S;printf(&#8221;    FT=%d&#8221;,S);printf(&#8221;    rBT=%d&#8221;,bt[i]);}</p>
<p>        }<br />
if(i=n)i=0;</p>
<p>}//while<br />
printf(&#8220;\n process execution order:\n&#8221;);<br />
for(i=0;i&lt;k;i++)<br />
printf(&quot;%d,&quot;,exe[i]);<br />
//for(i=0;i FT=%d,&#8221;,p[i],ft[i]);<br />
//or(i=0;i ST=%d,&#8221;,p[i],st[i]);<br />
for(i=0;i&lt;n;i++)<br />
tat[i]=ft[i]-at[i];<br />
for(i=0;i&lt;n;i++)<br />
wt[i]=tat[i]-BT[i];<br />
//&#8212;&#8212;&#8211;CALCULATING AV.WT &amp; AV.TAT&#8212;&#8211;<br />
for(i=0;i&lt;n;i++)<br />
{atat=atat+tat[i];awt=awt+wt[i];<br />
}<br />
atat=atat/n;<br />
awt=awt/n;<br />
//&#8212;&#8212;&#8212;&#8212;-DISPLAY&#8212;&#8212;&#8212;&#8212;&#8211;<br />
printf(&quot;\n&quot;);<br />
printf(&quot;process   start time    wait time    turn around time    finish time    burst time\n&quot;);<br />
for(i=0;i&lt;n;i++)<br />
printf(&quot;process %d     %d           %d            %d                 %d        %d\n&quot;,p[i],st[i],wt[i],tat[i],ft[i],BT[i]);<br />
printf(&quot;average wait time=%f \naverage turn around time=%f \n&quot;,awt,atat);</p>
<p>}//main</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: balu		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-40469</link>

		<dc:creator><![CDATA[balu]]></dc:creator>
		<pubDate>Wed, 22 Oct 2014 11:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-40469</guid>

					<description><![CDATA[where is output ?????????????/]]></description>
			<content:encoded><![CDATA[<p>where is output ?????????????/</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: aqeel		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10532</link>

		<dc:creator><![CDATA[aqeel]]></dc:creator>
		<pubDate>Fri, 02 May 2014 03:45:53 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-10532</guid>

					<description><![CDATA[i want simple code for preemptive round robin in c++ as early as  possible thanks in advance]]></description>
			<content:encoded><![CDATA[<p>i want simple code for preemptive round robin in c++ as early as  possible thanks in advance</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: humaira		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10403</link>

		<dc:creator><![CDATA[humaira]]></dc:creator>
		<pubDate>Mon, 13 Jan 2014 05:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-10403</guid>

					<description><![CDATA[plz give me code of round robin priorty base scheduling in c.reply as soon as possible]]></description>
			<content:encoded><![CDATA[<p>plz give me code of round robin priorty base scheduling in c.reply as soon as possible</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nn		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10392</link>

		<dc:creator><![CDATA[nn]]></dc:creator>
		<pubDate>Thu, 02 Jan 2014 07:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-10392</guid>

					<description><![CDATA[hi 
i want implementation of priority scheduling in c for xv6 perating system, can anyone kelp me?]]></description>
			<content:encoded><![CDATA[<p>hi<br />
i want implementation of priority scheduling in c for xv6 perating system, can anyone kelp me?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sujithra		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10249</link>

		<dc:creator><![CDATA[sujithra]]></dc:creator>
		<pubDate>Wed, 23 Oct 2013 15:04:27 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-10249</guid>

					<description><![CDATA[can i hav the code for priority pre emptive plz...]]></description>
			<content:encoded><![CDATA[<p>can i hav the code for priority pre emptive plz&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: rajat		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10233</link>

		<dc:creator><![CDATA[rajat]]></dc:creator>
		<pubDate>Thu, 17 Oct 2013 06:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-10233</guid>

					<description><![CDATA[#include #include #include void main() { clrscr(); int x,n,p[10],pp[10],pt[10],w[10],t[10],awt,atat,i; printf(&quot;Enter the number of process : &quot;); scanf(&quot;%d&quot;,&#038;n); printf(&quot;\n Enter process : time priorities \n&quot;); for(i=0;i&#060;n;i++) { printf(&#034;\nProcess no %d : &#034;,i+1); scanf(&#034;%d %d&#034;,&#038;pt[i],&#038;pp[i]); p[i]=i+1; } for(i=0;i&#060;n-1;i++) { for(int j=i+1;j&#060;n;j++) { if(pp[i]&#060;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]; atat=t[0]; for(i=1;i&#060;n;i++) { w[i]=t[i-1]; awt+=w[i]; t[i]=w[i]+pt[i]; atat+=t[i]; } printf(&#034;\n\n Job \t Burst Time \t Wait Time \t Turn Around Time Priority \n&#034;); for(i=0;i&#060;n;i++) printf(&#034;\n %d \t\t %d \t\t %d \t\t %d \t\t %d \n&#034;,p[i],pt[i],w[i],t[i],pp[i]); awt/=n; atat/=n; printf(&#034;\n Average Wait Time : %d \n&#034;,awt); printf(&#034;\n Average Turn Around Time : %d \n&#034;,atat); getch(); } - See more at: http://studentprojects.in/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/#sthash.GuPikOWE.dpuf]]></description>
			<content:encoded><![CDATA[<p>#include #include #include void main() { clrscr(); int x,n,p[10],pp[10],pt[10],w[10],t[10],awt,atat,i; printf(&#8220;Enter the number of process : &#8220;); scanf(&#8220;%d&#8221;,&amp;n); printf(&#8220;\n Enter process : time priorities \n&#8221;); 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(int 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]; 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(); } &#8211; See more at: <a href="http://studentprojects.in/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/#sthash.GuPikOWE.dpuf" rel="nofollow ugc">http://studentprojects.in/source-codes/software-programs/c/c-advanced-programs/c-program-for-priority-scheduling/#sthash.GuPikOWE.dpuf</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: choque		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-10160</link>

		<dc:creator><![CDATA[choque]]></dc:creator>
		<pubDate>Tue, 17 Sep 2013 04:42:30 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-10160</guid>

					<description><![CDATA[haloo.. Good day..

we need a simple non-preemptive Priority scheduling,,can anybody please help us.?.
Please help us..!! this is for our final project..just a simple program will do..
It input how many process,burst time and priority number then calculate the average time and waiting time..and print it&#039;s gantt chart.
Please do help us..we need it badly..
Thank you very much..Godbless us always.]]></description>
			<content:encoded><![CDATA[<p>haloo.. Good day..</p>
<p>we need a simple non-preemptive Priority scheduling,,can anybody please help us.?.<br />
Please help us..!! this is for our final project..just a simple program will do..<br />
It input how many process,burst time and priority number then calculate the average time and waiting time..and print it&#8217;s gantt chart.<br />
Please do help us..we need it badly..<br />
Thank you very much..Godbless us always.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nandini		</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-priority-scheduling/comment-page-1/#comment-9936</link>

		<dc:creator><![CDATA[nandini]]></dc:creator>
		<pubDate>Fri, 26 Jul 2013 06:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1122#comment-9936</guid>

					<description><![CDATA[plz post the ec prgm which runs and executable]]></description>
			<content:encoded><![CDATA[<p>plz post the ec prgm which runs and executable</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
