New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Resources » Articles/Knowledge Sharing » General »

Sjf scheduling program in c


Posted Date: 07 Nov 2009    Resource Type: Articles/Knowledge Sharing    Category: General
Author: karthickMember Level: Silver    
Rating: 3 out of 53 out of 53 out of 5Points: 2




#include
int main()
{
int n,b[12],b1[12],j[12],w[12],e[12];
int i,k,t,t1;
float aw=0,ae=0;
printf("\n Enter the number of Jobs:");
scanf("%d",&n);
for(i=0;i {
printf("Enter the bursttime of Job %d:",i+1);
scanf("%d",&b[i]);
b1[i]=b[i];
j[i]=i;
}
for(i=0;i for(k=0;k if(b1[i] {
t=b1[i];
b1[i]=b1[k];
b1[k]=t;
}
printf("\n Job \t bursttime \t Waitingtime \t Turnaroundtime");
for(i=0;i {
if(i==0)
{
w[0]=0;
e[0]=b1[0];
}
else
{ w[i]=e[i-1];
e[i]=e[i-1]+b1[i];
}
printf("\n %d \t\t %d \t\t %d \t\t %d",i+1,b1[i],w[i],e[i]);
aw+=w[i];
ae+=e[i];
}
aw/=n;
ae/=n;
printf("\n Average Waiting time is : %f",aw);
printf("\n Average Turnaround time is :%f",ae);
return(0);
}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
SOURCE CODE  .  SJF  .  SCHEDULING  .  PROGRAM  .  CODING  .  C LANGUAGE  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Round robin scheduling program in c
Previous Resource: Usage of fork, sleep, exec, wait system calls program in c
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
More Resources



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.