30th Aug 2022, 1:26 AM
Narasimha Reddy
Narasimha Reddy - avatar
1 Resposta
0
Conio.h isn't needed or ncessary. Most modern compilers don't even include it anymore. Try this: https://www.sololearn.com/compiler-playground/cFfIlUzP4ZQH // Created by Narasimha Reddy #include <stdio.h> int front = 0, rear = 0; int q[5]; int size = 5; void insertion(int n) { if (rear == size) printf("Queue is full\n"); else { q[rear] = n; rear++; } } void deletion() { if (front == rear) printf("Queue is empty\n"); else { front++; } } void display() { if (front == rear) { printf("Queue is empty\n"); } else { for (int i = front; i < rear; i++) printf("%d\n", q[i]); } } int main() { insertion(45); insertion(55); insertion(65); insertion(75); insertion(85); deletion(); display(); return 0; } :::::OUTPUT::::::: 55 65 75 85
2nd Jun 2023, 6:05 PM
AgentSmith