<?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 SJF CPU Scheduling Algorithm</title>
	<atom:link href="http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/feed/" rel="self" type="application/rss+xml" />
	<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/</link>
	<description>...bringing innovative minds together</description>
	<lastBuildDate>Mon, 21 May 2012 08:19:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Jyoti</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-7175</link>
		<dc:creator>Jyoti</dc:creator>
		<pubDate>Wed, 28 Mar 2012 04:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-7175</guid>
		<description>Thank u very much for ur programs. It helped me a lot in my OS subject....
Thank u...........</description>
		<content:encoded><![CDATA[<p>Thank u very much for ur programs. It helped me a lot in my OS subject&#8230;.<br />
Thank u&#8230;&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kj</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-7106</link>
		<dc:creator>kj</dc:creator>
		<pubDate>Thu, 15 Mar 2012 09:44:38 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-7106</guid>
		<description>import java.io.*;
import java.awt.*;
import java.applet.*;

public class Scorebar extends Applet
{
	int sri[]={3,3,1,4,6,2,9,1,0,3,8,7,8,3,5,1,10,2,3,0,5,8,2,5,6,11,3,7,7,4,5,6,4,5,11,4,3,6,3,2,2,1,2,4,3,9,4,9,12,4};
	int ind[]={2,4,7,6,4,1,2,8,8,2,3,2,7,5,7,5,6,0,3,1,10,1,3,5,1,6,5,8,4,9,2,3,3,4,8,2,5,7,4,5,0,2,2,4,5,13,5,4,15,4};
	
	public void init()
	{
	
	}
		public void paint(Graphics g)
		{
			try
			{
				int j=-5;
			for(int i=0;i&lt;50;i++)
			{
				g.setColor(Color.red);
				g.fillRect(j+5,200,5,sri[i]*10);
				g.setColor(Color.blue);
				j=j+5;
				g.fillRect(j+5,200,5,ind[i]*10);
				j=j+5;
			}
			}catch(Exception e){}
		}
}</description>
		<content:encoded><![CDATA[<p>import java.io.*;<br />
import java.awt.*;<br />
import java.applet.*;</p>
<p>public class Scorebar extends Applet<br />
{<br />
	int sri[]={3,3,1,4,6,2,9,1,0,3,8,7,8,3,5,1,10,2,3,0,5,8,2,5,6,11,3,7,7,4,5,6,4,5,11,4,3,6,3,2,2,1,2,4,3,9,4,9,12,4};<br />
	int ind[]={2,4,7,6,4,1,2,8,8,2,3,2,7,5,7,5,6,0,3,1,10,1,3,5,1,6,5,8,4,9,2,3,3,4,8,2,5,7,4,5,0,2,2,4,5,13,5,4,15,4};</p>
<p>	public void init()<br />
	{</p>
<p>	}<br />
		public void paint(Graphics g)<br />
		{<br />
			try<br />
			{<br />
				int j=-5;<br />
			for(int i=0;i&lt;50;i++)<br />
			{<br />
				g.setColor(Color.red);<br />
				g.fillRect(j+5,200,5,sri[i]*10);<br />
				g.setColor(Color.blue);<br />
				j=j+5;<br />
				g.fillRect(j+5,200,5,ind[i]*10);<br />
				j=j+5;<br />
			}<br />
			}catch(Exception e){}<br />
		}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: msgd</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-7105</link>
		<dc:creator>msgd</dc:creator>
		<pubDate>Thu, 15 Mar 2012 09:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-7105</guid>
		<description>import java.awt.*;
import java.applet.*;
public class UserIn extends Applet
{                
        TextField text1, text2;
        public void init()
        {
                Label lob1=new Label();
                Label lob2=new Label();
				Label lob3=new Label();
				Label lob4=new Label();
				Label lob5=new Label();
				Label lob6=new Label();
				Label lob7=new Label();
				Label lob8=new Label();
				Label lob9=new Label();
                lob1.setText(&quot;BE&quot;);
                lob2.setText(&quot;ES&quot;);
				lob3.setText(&quot;DMS&quot;);
				lob4.setText(&quot;DS&quot;);
                lob5.setText(&quot;PSQT&quot;);
				lob6.setText(&quot;FDL&quot;);
				lob7.setText(&quot;DS LAB&quot;);
				lob8.setText(&quot;BE LAB&quot;); 
				lob9.setText(&quot;ECS LAB&quot;);
				text1=new TextField(8);
                text2=new TextField(8);
                add(lob1);
                add (text1);
                add(lob2);
                add (text2);
                text1.setText (&quot;0&quot;);
                text2.setText (&quot;0&quot;);
        }
public void paint(Graphics g)
        {
                int x=0, y=0, z=0;
                String s1=null, s2=null, s=null;
                g.drawString(&quot;Input a number in each box&quot;,10,45);
                try
                {
                        s1=text1.getText();
                        x= Integer.parseInt(s1);
                        s2=text2.getText();
                        y= Integer.parseInt(s2);
                }
                catch (Exception ex) { System.out.println(ex);}
                z= x + y;
                s=String.valueOf(z);
                g.drawString (&quot;The Sum is: &quot;+s,10,75);
        }
        public boolean action (Event event, Object object)
        {
                repaint ();
                return true;
        }
}</description>
		<content:encoded><![CDATA[<p>import java.awt.*;<br />
import java.applet.*;<br />
public class UserIn extends Applet<br />
{<br />
        TextField text1, text2;<br />
        public void init()<br />
        {<br />
                Label lob1=new Label();<br />
                Label lob2=new Label();<br />
				Label lob3=new Label();<br />
				Label lob4=new Label();<br />
				Label lob5=new Label();<br />
				Label lob6=new Label();<br />
				Label lob7=new Label();<br />
				Label lob8=new Label();<br />
				Label lob9=new Label();<br />
                lob1.setText(&#8220;BE&#8221;);<br />
                lob2.setText(&#8220;ES&#8221;);<br />
				lob3.setText(&#8220;DMS&#8221;);<br />
				lob4.setText(&#8220;DS&#8221;);<br />
                lob5.setText(&#8220;PSQT&#8221;);<br />
				lob6.setText(&#8220;FDL&#8221;);<br />
				lob7.setText(&#8220;DS LAB&#8221;);<br />
				lob8.setText(&#8220;BE LAB&#8221;);<br />
				lob9.setText(&#8220;ECS LAB&#8221;);<br />
				text1=new TextField(8);<br />
                text2=new TextField(8);<br />
                add(lob1);<br />
                add (text1);<br />
                add(lob2);<br />
                add (text2);<br />
                text1.setText (&#8220;0&#8243;);<br />
                text2.setText (&#8220;0&#8243;);<br />
        }<br />
public void paint(Graphics g)<br />
        {<br />
                int x=0, y=0, z=0;<br />
                String s1=null, s2=null, s=null;<br />
                g.drawString(&#8220;Input a number in each box&#8221;,10,45);<br />
                try<br />
                {<br />
                        s1=text1.getText();<br />
                        x= Integer.parseInt(s1);<br />
                        s2=text2.getText();<br />
                        y= Integer.parseInt(s2);<br />
                }<br />
                catch (Exception ex) { System.out.println(ex);}<br />
                z= x + y;<br />
                s=String.valueOf(z);<br />
                g.drawString (&#8220;The Sum is: &#8220;+s,10,75);<br />
        }<br />
        public boolean action (Event event, Object object)<br />
        {<br />
                repaint ();<br />
                return true;<br />
        }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi Kumar</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-7084</link>
		<dc:creator>Ravi Kumar</dc:creator>
		<pubDate>Wed, 14 Mar 2012 01:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-7084</guid>
		<description>b) SJF:
AIM: A program to simulate the SJF CPU scheduling algorithm
PROGRAM:
#include
#include
#include
void main()
{
int et[20],at[10],n,i,j,temp,st[10],ft[10],wt[10],ta[10];
int totwt=0,totta=0;
float awt,ata;
char pn[10][10],t[10];
clrscr();
printf(&quot;Enter the number of process:&quot;);
scanf(&quot;%d&quot;,&amp;n);
for(i=0;i&lt;n;i++)
{
printf(&quot;Enter process name, arrival time &amp; execution time:&quot;);
flushall();
scanf(&quot;%s%d%d&quot;,pn[i],&amp;at[i],&amp;et[i]);
}
for(i=0;i&lt;n;i++)
for(j=0;j&lt;n;j++)
{
if(et[i]&lt;et[j])
{
temp=at[i];
at[i]=at[j];
at[j]=temp;
temp=et[i];
et[i]=et[j];
et[j]=temp;
strcpy(t,pn[i]);
strcpy(pn[i],pn[j]);
strcpy(pn[j],t);
}
}
for(i=0;i&lt;n;i++)
{
if(i==0)
st[i]=at[i];
else
6
st[i]=ft[i-1];
OS Lab Manual K. Ravi Chythanya
wt[i]=st[i]-at[i];
ft[i]=st[i]+et[i];
ta[i]=ft[i]-at[i];
totwt+=wt[i];
totta+=ta[i];
}
awt=(float)totwt/n;
ata=(float)totta/n;
printf(&quot;\nPname\tarrivaltime\texecutiontime\twaitingtime\ttatime&quot;);
for(i=0;i&lt;n;i++)
printf(&quot;\n%s\t%5d\t\t%5d\t\t%5d\t\t%5d&quot;,pn[i],at[i],et[i],wt[i],ta[i]);
printf(&quot;\nAverage waiting time is:%f&quot;,awt);
printf(&quot;\nAverage turnaroundtime is:%f&quot;,ata);
getch();
}
OUTPUT:
Input:
Enter the number of processes: 3
Enter the Process Name, Arrival Time &amp; Burst Time: 1 4 6
Enter the Process Name, Arrival Time &amp; Burst Time: 2 5 15
Enter the Process Name, Arrival Time &amp; Burst Time: 3 6 11
Output:
Pname arrivaltime executiontime waitingtime tatime
1 4 6 0 6
3 6 11 4 15
2 5 15 16 31
Average Waiting Time: 6.6667
Average Turn Around Time: 17.3333</description>
		<content:encoded><![CDATA[<p>b) SJF:<br />
AIM: A program to simulate the SJF CPU scheduling algorithm<br />
PROGRAM:<br />
#include<br />
#include<br />
#include<br />
void main()<br />
{<br />
int et[20],at[10],n,i,j,temp,st[10],ft[10],wt[10],ta[10];<br />
int totwt=0,totta=0;<br />
float awt,ata;<br />
char pn[10][10],t[10];<br />
clrscr();<br />
printf(&#8220;Enter the number of process:&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;n);<br />
for(i=0;i&lt;n;i++)<br />
{<br />
printf(&quot;Enter process name, arrival time &amp; execution time:&quot;);<br />
flushall();<br />
scanf(&quot;%s%d%d&quot;,pn[i],&amp;at[i],&amp;et[i]);<br />
}<br />
for(i=0;i&lt;n;i++)<br />
for(j=0;j&lt;n;j++)<br />
{<br />
if(et[i]&lt;et[j])<br />
{<br />
temp=at[i];<br />
at[i]=at[j];<br />
at[j]=temp;<br />
temp=et[i];<br />
et[i]=et[j];<br />
et[j]=temp;<br />
strcpy(t,pn[i]);<br />
strcpy(pn[i],pn[j]);<br />
strcpy(pn[j],t);<br />
}<br />
}<br />
for(i=0;i&lt;n;i++)<br />
{<br />
if(i==0)<br />
st[i]=at[i];<br />
else<br />
6<br />
st[i]=ft[i-1];<br />
OS Lab Manual K. Ravi Chythanya<br />
wt[i]=st[i]-at[i];<br />
ft[i]=st[i]+et[i];<br />
ta[i]=ft[i]-at[i];<br />
totwt+=wt[i];<br />
totta+=ta[i];<br />
}<br />
awt=(float)totwt/n;<br />
ata=(float)totta/n;<br />
printf(&quot;\nPname\tarrivaltime\texecutiontime\twaitingtime\ttatime&quot;);<br />
for(i=0;i&lt;n;i++)<br />
printf(&quot;\n%s\t%5d\t\t%5d\t\t%5d\t\t%5d&quot;,pn[i],at[i],et[i],wt[i],ta[i]);<br />
printf(&quot;\nAverage waiting time is:%f&quot;,awt);<br />
printf(&quot;\nAverage turnaroundtime is:%f&quot;,ata);<br />
getch();<br />
}<br />
OUTPUT:<br />
Input:<br />
Enter the number of processes: 3<br />
Enter the Process Name, Arrival Time &amp; Burst Time: 1 4 6<br />
Enter the Process Name, Arrival Time &amp; Burst Time: 2 5 15<br />
Enter the Process Name, Arrival Time &amp; Burst Time: 3 6 11<br />
Output:<br />
Pname arrivaltime executiontime waitingtime tatime<br />
1 4 6 0 6<br />
3 6 11 4 15<br />
2 5 15 16 31<br />
Average Waiting Time: 6.6667<br />
Average Turn Around Time: 17.3333</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tamie Caffarelli</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-7079</link>
		<dc:creator>Tamie Caffarelli</dc:creator>
		<pubDate>Mon, 12 Mar 2012 14:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-7079</guid>
		<description>Business, that&#039;s easily defined - it&#039;s other people&#039;s money.
Individuals will buy anything that is &#039;one to a customer.&#039;</description>
		<content:encoded><![CDATA[<p>Business, that&#8217;s easily defined &#8211; it&#8217;s other people&#8217;s money.<br />
Individuals will buy anything that is &#8216;one to a customer.&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amey</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-6963</link>
		<dc:creator>amey</dc:creator>
		<pubDate>Wed, 22 Feb 2012 14:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-6963</guid>
		<description>please upload pre-emptive algorithms pgm-fcfs,srtf,rr,priority</description>
		<content:encoded><![CDATA[<p>please upload pre-emptive algorithms pgm-fcfs,srtf,rr,priority</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sri</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-6825</link>
		<dc:creator>sri</dc:creator>
		<pubDate>Mon, 06 Feb 2012 14:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-6825</guid>
		<description>plz do try 2 post codes for preemptive scheduling also</description>
		<content:encoded><![CDATA[<p>plz do try 2 post codes for preemptive scheduling also</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: murali krishna</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-6525</link>
		<dc:creator>murali krishna</dc:creator>
		<pubDate>Sat, 31 Dec 2011 04:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-6525</guid>
		<description>i want all cpu scheduling algorithms with programmes
tell me any site 
but remeber one thing i want small programmes</description>
		<content:encoded><![CDATA[<p>i want all cpu scheduling algorithms with programmes<br />
tell me any site<br />
but remeber one thing i want small programmes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-6392</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Mon, 12 Dec 2011 12:40:40 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-6392</guid>
		<description>Fucking syntax errors . don&#039;t know how to fix it .</description>
		<content:encoded><![CDATA[<p>Fucking syntax errors . don&#8217;t know how to fix it .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: preetam</title>
		<link>http://electrofriends.com/source-codes/software-programs/c/c-program-for-sjf-cpu-scheduling-algorithm/comment-page-2/#comment-6311</link>
		<dc:creator>preetam</dc:creator>
		<pubDate>Sun, 04 Dec 2011 11:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://electrofriends.com/?p=787#comment-6311</guid>
		<description>Can any1 help me wid c code for multilevel round roubin scheduling pls???</description>
		<content:encoded><![CDATA[<p>Can any1 help me wid c code for multilevel round roubin scheduling pls???</p>
]]></content:encoded>
	</item>
</channel>
</rss>

