#include#include void insert(int); int del(); int queue[MAX], rear=0, front=0; void display(); int main() { char ch , a='y'; int choice, token; printf("1.Insert"); printf("\n2.Delete"); printf("\n3.show or display"); do { printf("\nEnter your choice for the operation: "); scanf("%d",&choice); switch(choice) { case 1: insert(token); display(); break; case 2: token=del(); printf("\nThe token deleted is %d",token); display(); break; case 3: display(); break; default: printf("Wrong choice"); break; } printf("\nDo you want to continue(y/n):"); ch=getch(); } while(ch=='y'||ch=='Y'); getch(); } void display() { int i; printf("\nThe queue elements are:"); for(i=rear;i#define MAX 10 "%d "
Saturday, May 3, 2014
Queue using Array in C
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment