<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CPU Scheduling | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/cpu-scheduling/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 20 Sep 2009 06:28:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C program for SJF CPU Scheduling Algorithm</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-sjf-cpu-scheduling-algorithm/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-sjf-cpu-scheduling-algorithm/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 20 Sep 2009 05:05:43 +0000</pubDate>
				<category><![CDATA[C Programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[CPU Scheduling]]></category>
		<category><![CDATA[CPU Sched]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=787</guid>

					<description><![CDATA[<p>OUTPUT:<br />
enter no of processes: 5</p>
<p>enter process1 name: aaa<br />
enter process time: 4<br />
enter process2 name: bbb<br />
enter process time: 3<br />
enter process3 name: ccc<br />
enter process time: 2<br />
enter process4 name: ddd<br />
enter process time: 5<br />
enter process5 name: eee<br />
enter process time: 1</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-program-for-sjf-cpu-scheduling-algorithm/">C program for SJF CPU Scheduling Algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>OUTPUT:<br />
enter no of processes: 5</p>
<p>enter process1 name: aaa<br />
enter process time: 4<br />
enter process2 name: bbb<br />
enter process time: 3<br />
enter process3 name: ccc<br />
enter process time: 2<br />
enter process4 name: ddd<br />
enter process time: 5<br />
enter process5 name: eee<br />
enter process time: 1</p>
<p>p_name  P_time  w_time</p>
<p> eee	1	0<br />
 ccc	2	1<br />
 bbb	3	3<br />
 aaa	4	6<br />
 ddd	5	10<br />
total waiting time=20<br />
avg waiting time=4.00</p>
<pre lang="c" escaped="true" line="1">
#include<stdio.h>
#include<conio.h>
#include<process.h>
void main()
{
char p[10][5],temp[5];
int tot=0,wt[10],pt[10],i,j,n,temp1;
float avg=0;
clrscr();
printf("enter no of processes:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("enter process%d name:\n",i+1);
scanf("%s",&#038;p[i]);
printf("enter process time");
scanf("%d",&#038;pt[i]);
}
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(pt[i]>pt[j])
{
temp1=pt[i];
pt[i]=pt[j];
pt[j]=temp1;
strcpy(temp,p[i]);
strcpy(p[i],p[j]);
strcpy(p[j],temp);
}
}
}
wt[0]=0;
for(i=1;i<n;i++)
{
wt[i]=wt[i-1]+et[i-1];
tot=tot+wt[i];
}
avg=(float)tot/n;
printf("p_name\t P_time\t w_time\n");
for(i=0;i<n;i++)
printf("%s\t%d\t%d\n",p[i],et[i],wt[i]);
printf("total waiting time=%d\n avg waiting time=%f",tot,avg);
getch();
}

</pre>
<p>OUTPUT:<br />
enter no of processes: 5</p>
<p>enter process1 name: aaa<br />
enter process time: 4<br />
enter process2 name: bbb<br />
enter process time: 3<br />
enter process3 name: ccc<br />
enter process time: 2<br />
enter process4 name: ddd<br />
enter process time: 5<br />
enter process5 name: eee<br />
enter process time: 1</p>
<p>p_name  P_time  w_time</p>
<p> eee	1	0<br />
 ccc	2	1<br />
 bbb	3	3<br />
 aaa	4	6<br />
 ddd	5	10<br />
total waiting time=20<br />
avg waiting time=4.00</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-program-for-sjf-cpu-scheduling-algorithm/">C program for SJF CPU Scheduling Algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-sjf-cpu-scheduling-algorithm/feed/</wfw:commentRss>
			<slash:comments>48</slash:comments>
		
		
			</item>
		<item>
		<title>C program for Round Robin CPU Scheduling Algorithm</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-round-robin-cpu-scheduling-algorithm/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-round-robin-cpu-scheduling-algorithm/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 20 Sep 2009 04:54:54 +0000</pubDate>
				<category><![CDATA[C Programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Round Robin]]></category>
		<category><![CDATA[CPU Scheduling]]></category>
		<category><![CDATA[download programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=785</guid>

					<description><![CDATA[<p>INPUT : enter the process name : aaa enter the processing time : 4 enter the process name : bbb enter the processing time : 3 enter the process name : ccc enter the processing time : 2 enter the process name : ddd enter the processing time : 5 enter the process name :</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-program-for-round-robin-cpu-scheduling-algorithm/">C program for Round Robin CPU Scheduling Algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>INPUT :<br />
enter the process name :   aaa<br />
enter the processing time : 4<br />
enter the process name :   bbb<br />
enter the processing time : 3<br />
enter the process name :   ccc<br />
enter the processing time : 2<br />
enter the process name :   ddd<br />
enter the processing time : 5<br />
enter the process name :   eee<br />
enter the processing time : 1</p>
<p>OUTPUT :</p>
<p>p_name	p_time	w_time<br />
aaa     4	9<br />
bbb     3	3<br />
ccc     2	6<br />
ddd     5	10<br />
eee     1  	11 </p>
<p>total waiting time : 39<br />
average waiting time : 7.8000</p>
<pre lang="c" escaped="true" line="1">
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<string.h>
void main()
{
char p[10][5];
int et[10],wt[10],timer=3,count,pt[10],rt,i,j,totwt=0,t,n=5,found=0,m;
float avgwt;
clrscr();
for(i=0;i<n;i++)
{
printf("enter the process name : ");
scanf("%s",&#038;p[i]);
printf("enter the processing time : ");
scanf("%d",&#038;pt[i]);
}
m=n;
wt[0]=0;
i=0;
do
{
if(pt[i]>timer)
{
rt=pt[i]-timer;
strcpy(p[n],p[i]);
pt[n]=rt;
et[i]=timer;
n++;
}
else
{
et[i]=pt[i];
}
i++;
wt[i]=wt[i-1]+et[i-1];
}while(i<n);

count=0;
for(i=0;i<m;i++)
{
for(j=i+1;j<=n;j++)
{
if(strcmp(p[i],p[j])==0)
{
count++;
found=j;
}
}
	if(found!=0)
	{

	wt[i]=wt[found]-(count*timer);
	count=0;
	found=0;
	}
}
for(i=0;i<m;i++)
{
totwt+=wt[i];
}
avgwt=(float)totwt/m;
for(i=0;i<m;i++)
{
printf("\n%s\t%d\t%d",p[i],pt[i],wt[i]);
}
printf("\ntotal waiting time %d\n",totwt);
printf("total avgtime %f",avgwt);
}
</pre>
<p>INPUT :<br />
enter the process name :   aaa<br />
enter the processing time : 4<br />
enter the process name :   bbb<br />
enter the processing time : 3<br />
enter the process name :   ccc<br />
enter the processing time : 2<br />
enter the process name :   ddd<br />
enter the processing time : 5<br />
enter the process name :   eee<br />
enter the processing time : 1</p>
<p>OUTPUT :</p>
<p>p_name	p_time	w_time<br />
aaa     4	9<br />
bbb     3	3<br />
ccc     2	6<br />
ddd     5	10<br />
eee     1  	11 </p>
<p>total waiting time : 39<br />
average waiting time : 7.8000</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-program-for-round-robin-cpu-scheduling-algorithm/">C program for Round Robin CPU Scheduling Algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/c-program-for-round-robin-cpu-scheduling-algorithm/feed/</wfw:commentRss>
			<slash:comments>62</slash:comments>
		
		
			</item>
	</channel>
</rss>
