Skip to main content

Posts

Featured

PROGRAM FOR QUEUE (INSERTION & DELETION)

#include<iostream.h> #include<conio.h> #include<stdio.h> #include<process.h> # define size 5 class queue {   int front,rear,a[size];   public:   queue()   {     front=0;rear=0;   }   void addQ(int item)   {     if(rear==size)        cout<<"Queue is full"<<endl;     else        a[rear++]=item;   }   void delQ(int item)   {     if(front==rear)     {        cout<<"Queue is empty"<<endl;     }     else     { a[front++];     }   }   void display()   {     int i;     if(front==rear)     {       cout<<"\n Queue is empty";       getch();       return;     }     for(i=front+1;i<=rear;i++)       cout<<a[i]<<"\t";   } }; void main() {   queue q1;   int item;   clrscr();   int choice;   do   {     clrscr();     cout<<endl<<"Main menu";     cout<<endl<<"1.Add\t 2.Delete\t 3.Display\t 4.Quit\t&q

Latest posts

CREATE A STRUCTURE BOOK FOR 20 RECORDS IN BINARY FILE- book_id, book_name, publisher_name, cost

WAP TO WRITE 10 RECORDS OF STUDENT IN BINARY FILE

WAP to calculate GST

A SIMPLE PROGRAM USING INITIALISATION FUNCTION

PROGRAM WITH HYBRID INHERITENCE

PROGRAM TO CALCULATE NUMBER OF WORD AND DIGITS IN THE FILE

// BANK //

A CLASS CIRCLE STORES AS A DATA MEMBER THE RADIUS AND AREA OF CIRCLE AND TWO CONSTRUCTOR FUNCTIONS. THE FIRST ACCEPTS ARGUMENT AS TH RADIUS AND CALCULATE ITS AREA. THE SECOND IS A COPY CONSTRUCTOR THAT INCREASES THE AREA OF CIRCLE BY 1 AND CALCULATE ITS AREA. ALSO, INCLUDE ANOTHER MEMBER FUNCTION TO DISPLAY RADIUS AND AREA OF THE CIRCLE.

PROGRAM FOR DEFINING A CLASS ADMISSION USING CONSTRUCTOR.

PROGRAM FOR DEFINING A CLASS FIBONACCI USING CONSTRUCTOR.