Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

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

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");
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 : ");

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);

case 2:
	printf("Display All Books Available\n");
	printf ("\n book name = %s",l[i].bk_name);
	printf ("\t author name = %s",l[i].publisher);

	printf ("\t  price = %f",l[i].price);

case 3:
	printf ("Highest Price Book : ");
float temp = 0;
	for (i=0;i<keepcount;i++)
	    if(temp < l[i].price)
	        temp = l[i].price;
	printf("%f", temp);

case 4:
	printf ("List of Publishers : ");
	for (i=0;i<keepcount;i++)
	    printf ("\n %s ",l[i].publisher);

case 5:
	exit (0); 
return 0;

Execution of Library Management Project

C project on library management for beginners