

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include<stdio.h> #include<conio.h> #include<iostream.h> struct stu { char reg[30]; char name[30]; float marks; struct stu next; }; int choice=0,srn; struct stu current,p,first,*last;char key[30];
void input (void); void insert_end (void); void del_start (void); void display (void);
void main () { first=NULL; last=NULL; clrscr(); while (choice!=4) { clrscr(); cout<<"\n\t\tImplementing QUEUE in student information system.\n\n\nEnter one of the following options:\n\n\t\t- To ENQUEUE a node press:\t1\n\t\t-
case 2: /To DEQUEUE DATA/ del_start(); getch(); break;
case 3: /To Display/ display(); getch(); break;
default: cout<<"\nYou entered the WRONG choice!! Enter again\n"; }
} }
void input (void) { current=new stu;
current->next=NULL; cout<<"\n\n\nEnter Registration # of the student:\t"; cin>>current->reg; cout<<"Enter Name of the student:\t"; cin>>current->name; cout<<"Enter Marks of the student:\t"; cin>>current->marks; }
void insert_end (void) { input(); if(first==NULL) { first=last=current; } else { last->next=current; last=current; } }
void display (void) { p=first;srn=1;
if(p==NULL) { cout<<"\nThere is no DATA in the list\n"; } else { while (p!=NULL) { cout<<"\n\n Student #: "<<srn; cout<<"\n\n\tRegistration number:\t"<<p->reg; cout<<"\n\tName:\t"<<p->name; cout<<"\n\tMarks:\t"<<p->marks<<"\n"; p=p->next;srn++; } } }
void del_start (void) { if(first==NULL) { cout<<"\nThere is no DATA in the list\n"; } if(first==last) { delete(p); first=last=NULL;