Circular Queue in C using Array

Circular Queue in C using Array

Here you will get the program code of Circular Queue in C programming using Array. It is simple program to understand the circular queue concept in in Data Structure.

What is Circular Queue?

A circular queue is an abstract data type that includes a collection of data and allows for data addition at the end of the queue and data removal at the beginning. Circular queues have a fixed size.
Circular queue follows FIFO(First In, First Out) principle. Items are added to the circular queue at the back end, and eliminated at the front end.

Program code of Circular Queue in C

Output

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 1
Enter the value to enqueue: 100

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 1
Enter the value to enqueue: 200

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 1
Enter the value to enqueue: 300

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 3

Circular Queue elements: 100 200 300

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 2
Dequeued: 100

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 3

Circular Queue elements: 200 300

Circular Queue Menu:
1. Enqueue
2. Dequeue
3. Display
4. Quit
Enter your choice: 4

 

 

 

Leave a Comment

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

Scroll to Top