C program to simulate the cpu scheduling priority algorithm.
Concept: To calculate the average waiting time in the priority algorithm, sort the burst times according to their priorities and then calculate the average waiting time of the processes. The…