Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<iostream.h>#include<conio.h>#include<string.

h>void main(){clrscr();char
respo,query[20],answer;struct bookdata
{chartitle[20],author[20],lang[20],nop[20],publisher[20],price[20]; };int
counter=0,i,c=0,addinfo=0;struct bookdata bd[10];start:if(counter==11)
{clrscr();cout<<"Limit Reached!";getch();goto end;}clrscr();cout<<"\t\tWelcome to
Library Management System \n";cout<<"\t\
t_______________________________________";cout<<"\n\n\t\tPress 1 to Add Books.\
n";cout<<"\t\tPress 2 to Delete Books.\n";cout<<"\t\tPress 3 to View list of
Books.\n";cout<<"\t\tPress 4 to Issue Books.\n";cout<<"\t\tPress 5 to Exit !\n\
t";cout<<"\n\n\n\tEnter your choice";cin>>respo;switch(respo){case '1': counter+
+;clrscr();addinfo=1; cout<<"\n\tEnter title name:\t";cin>>bd[counter].title;
cout<<"\n\tEnter Author Name:\t";cin>>bd[counter].author; cout<<"\n\tEnter
Language:\t";cin>>bd[counter].lang; cout<<"\n\tEnter Number of pages:\
t";cin>>bd[counter].nop; cout<<"\n\tEnter Publisher:\t";cin>>bd[counter].publisher;
cout<<"\n\tEnter Price:\t";cin>>bd[counter].price; cout<<"\n\t-----Book is
Added-----\t"; cout<<"\n\n\n\t\tIf you want to go Home press 'y' or press 'n'
forno.\n"; cin>>answer; if(answer=='y'){goto start;} else{goto end;} getch(); goto
start; break; case '2': clrscr(); int delinfo=1;cout<<"\n\t\tEnter the Title of
book you want to delete:\t";cin>>query; for(i=1;i<=counter;i++)
{if(strcmp(query,bd[i].title)){ delinfo=1; } else{ delinfo++; deleted: clrscr();
cout<<"\n\t\t We found 1 book with entered name!\n"; cout<<"\n\n\t\t DO YOU WANT TO
DELETETHIS BOOK?? press y or n:\n"; cin>>answer;
10

You might also like