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.

Must Read: C Program For Priority Scheduling Algorithm in OS

About FCFS 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.

Must Read: C Program For SJF Algorithm without Arrival Time

Also Read: C Program For Encryption and Decryption of Text Files

First Come First Serve CPU Scheduling Algorithm C Program using Array

Also Read: Convert Numbers To Words in C Programming


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.

Tushar Soni

I am Tushar Soni, Co - Founder of CodingAlpha. I am a computer science student from India and passionate about Web Development and Programming. Connect with me on Facebook | LinkedIn | Google Plus

9 thoughts on “First Come First Serve Algorithm C Program

  • June 3, 2016 at 4:09 am

    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.

  • August 24, 2016 at 5:44 pm

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

  • August 26, 2016 at 4:51 pm

    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?

    • August 26, 2016 at 4:55 pm

      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
  • August 29, 2016 at 7:35 pm

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

    • August 30, 2016 at 8:29 am

      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.

  • October 5, 2016 at 4:04 pm

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

  • October 6, 2016 at 5:11 pm

    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.


Join The Discussion