Warning: mysqli_connect(): (HY000/2002): Connection refused in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 38

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 40

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 41

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 45

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 48

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 49
Program for First Come First Serve (FCFS) scheduling technique - Get Program Code
Home / C / Program for First Come First Serve (FCFS) scheduling technique

Program for First Come First Serve (FCFS) scheduling technique

This is the program for First Come First Serve scheduling technique usually implemented in Operating system for scheduling programs

#include "stdio.h"
#include "conio.h"
void main()
{
int i,npro,btime[30],wtime[30],turntime[30],avgwtime,temp=0;
clrscr();
printf("\nEnter the no. of Programs");
scanf("%d",&npro);
for(i=0;i<npro;i++)
{
printf("\nEnter the burst time of process %d",i+1);
scanf("%d",&btime[i]);
}
//Calculation start for First Come First Serve Scheduling
wtime[0]=0;
for(i=1;i<npro;i++)
{
wtime[i]=btime[i-1]+wtime[i-1];
}
for(i=0;i<npro;i++)
{
temp=temp+wtime[i];
}
avgwtime=temp/npro;
for(i=0;i<npro;i++)
{
turntime[i]=wtime[i]+btime[i];
}
for(i=0;i<npro;i++)
{
printf("\nTurnaround Time Of Process %d is %d",i+1,turntime[i]);
}
for(i=0;i<npro;i++)
{
printf("\nWaiting Time Of Process %d is %d",i+1,wtime[i]);
}
printf("\nAverage Waiting Time Is %d",avgwtime);
getch();
}

 

OUTPUT

 

Incoming Terms: C program for FCFS, First Come first Serve scheduling Program.

Check Also

Restrict Mouse Pointer Position C Graphics Program

This C Program will restrict the Mouse Pointer location or to a particular position or x,y ...

One comment

  1. nice program… 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.