First Come First Served (FCFS):
In operating systems, tasks that are queued to be processed go through different scheduling algorithms in different operating systems. First Come First Served or FCFS is one of them.
In first come first served, literary, the task that comes first to be processed gets processed first, then the next one and this continues. This is a less preferable way of scheduling as any task can block the processor for infinite amount of time. Also as all tasks are given the same priority, more important tasks might be waiting too long to be processed.
However, I explained First Come First Served (FCFS) in my another post earlier and as many of my readers wanted to have the source code, here I am publishing the source code of the program. I am not currently explaining the source code, please try to play with it to understand it. I am removing comments intentionally.
Following is a screenshot of the program with input and output.
I hope that you can now study and experiment the source code to write yours and that would be much better, more efficient and strict than this one.