First Come First Serve Algorithm C Program

C Program To Implement First Come First Serve Algorithm

Learn How To Implement First Come First Serve Algorithm in C Programming Language. The FCFS Scheduling Algorithm is a Disk Scheduling Algorithm for processes that are needed to be executed. The FCFS Algorithm is normally represented using Gantt’s Chart on paper.

What is First Come First Serve Algorithm?

The First Come First Serve CPU Scheduling Algorithm is the simplest and easiest to implement among all the other scheduling algorithms. It works on the FIFO principle which is First In First Out. FCFS algorithm is a non-preemptive scheduling algorithm. Therefore, once the CPU is allocated to a particular process, it keeps working on that process till it finishes its job. It cannot move to another process in the queue.


However, the FCFS disk scheduling algorithm is not good performance-wise. It has a high average waiting time and high average turnaround time too. This makes it less efficient for Time-Sharing systems. The average wait time for FCFS algorithm is not minimum and it varies greatly depending upon the Burst Time of the processes.

First Come First Serve CPU Scheduling Algorithm C Program using Array



C Program For First Come First Serve Algorithm

If you have any compilation errors or doubts in this C Program to Implement First Come First Serve Algorithm, let us know about in the Comment Section below.

CPU Scheduling Algorithms
C Program To Implement Preemptive SJF Preemptive Algorithm
C Program For Quick Sort Algorithm
C Program To Implement Round Robin Scheduling Algorithm
C Program For Queens Algorithm Problem
C Program To Implement Multi Level Feedback Queue Scheduling Algorithm
Difference Between C and Java Programming
C Program For Encryption and Decryption of Text Files
C Program To Implement Shortest Job First Algorithm
C Program For Preemptive Priority Scheduling Algorithm
C Program To Implement Priority Scheduling Algorithm

10 thoughts on “First Come First Serve Algorithm C Program

  1. Ajay Sawant

    Fantastic. I need codes on SJF and Round Robin Scheduling algorithms. Can you please upload that too? The FCFS output has made my work more easier.

  2. Vikas Gandhi

    I think SJF algorithm is more efficient than the FCFS algorithm due to its turnaround time.

  3. Vineet Daniel

    FCFS algorithm does not seem to process efficiently. Its turnaround time is too much compared to other scheduling algorithms. Which is the best scheduling algorithm for CPU Scheduling in C Programming?

    1. Tushar Soni Post author

      There is no such thing as which is the best. It all depends upon what work you intend the CPU to process. However, here are some of the most efficient CPU Scheduling Algorithms which you can implement in C Programming as well.

      • Round Robin Scheduling
      • Priority Scheduling
      • Multi Level Queue Scheduling
      • Shortest Job First
  4. Rahul Sharma

    Great Program. Works perfectly fine. But it is quite difficult to grasp. However, it helped in my submissions! 🙂

    1. Tushar Soni Post author

      Yes. It is a little difficult but not impossible. I would suggest you to solve few FCFS problems first. You will get the logic and converting it in a programming language would not be much harder then.

  5. Rajiv Makhija

    Can I implement a preemptive FCFS algorithm in C programming? Please help.

  6. Milind Kothari

    This is one of most basic disk schedulong algorithms and I do not recommend it to be used. They are way better cpu scheduling algorithms than this. See sjf, rr and many more.

  7. Vineeth Daniel

    The FCFS CPU Scheduling Algorithm is rarely used nowadays. However, it is used with some other algorithms as a part and combined to form a new algorithm. For example, a situation can be handled better by both SJF and FCFS algorithms when used together.


Let's Discuss