Home » C » C projects » Project on Library Management
C Project on Library Management -v1
Project for C beginners. Structure is used to store books records with options to Add books, Display all books, Find highest price, Display list of publishers.
Source Code
/* Program: Library Management Author: CppBuzz Date: 17th Nov 2017 */ #include #include #include struct library { char bk_name[30]; char publisher[30]; float price; }; int main() { struct library l[100]; char pb_nm[30],bk_nm[30]; int i,j, keepcount; i=j=keepcount = 0; printf("\n\n## Library Management ##\n"); while(j!=5) { printf("\n1. Add book information\n"); printf("2. Display All Books Available \n"); printf("3. Display Highest Price Book\n"); printf("4. Display list of Publishers\n"); printf("5. Exit"); printf ("\n\nEnter one of the above : "); scanf("%d",&j); switch (j) { /* Add book */ case 1: printf ("Enter book name = "); scanf ("%s",l[i].bk_name); printf ("Enter publisher name = "); scanf ("%s",l[i].publisher); printf ("Enter price = "); scanf ("%f",&l[i].price); keepcount++; break; case 2: printf("Display All Books Available\n"); for(i=0;i