Ps (Library Managemetn System)
Ps (Library Managemetn System)
(CSE23201)
Studio.h:
"studio.h" is not a standard C library or a widely recognized component. It is possible that it is a
header file from a specific software development environment, library or framework. Can you
provide more context or specify what you would like to know about it
Stdlib.h:
stdlib.h is a standard C library header file that provides various utility functions, including
memory allocation, random number generation, and conversion of numbers to strings. It also
defines several macros and types, such as the NULL pointer constant and the size_t type. Some
of the most commonly used functions in stdlib.h are malloc(), calloc(), free(), atoi(), and rand().
String.h:
string.h is a standard C library header file that provides various string manipulation functions,
such as copying, concatenating, comparing, and searching strings. It also defines several
macros, such as NULL and size_t, as well as several types, such as size_t. Some of the most
commonly used functions in string.h are strcpy(), strcat(), strcmp(), strlen(), and memset().
While loop:
A while loop is a control flow statement in programming that allows the execution of a block
of code repeatedly as long as a specified condition is true.
There is evaluated before each iteration of the loop. If it is true, the statement(s) inside the
loop are executed, and the process repeats until the condition becomes false. If the condition
Switch case:
A switch case is a control flow statement in programming that allows the selection of an execution
path based on a specified expression value. It is often used as an alternative to multiple if-else
statements. its value is compared with the values specified in each case statement. If a match is found,
the statement(s) corresponding to that case are executed. The break statement is used to exit the
switch case, preventing execution of the subsequent cases. If no match is found, the default case is
executed if specified, otherwise the switch case is exited without executing any statement.
Source-Code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct book {
char title[50];
char author[50];
int book_id;
};
int main() {
struct book books[100];
int num_books = 0;
int choice;
while (1) {
printf("1. Add Book\n");
printf("2. Search Book\n");
printf("3. Display All Books\n");
printf("4. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch(choice) {
case 1:
add_book(books, &num_books);
break;
case 2:
search_book(books, num_books);
break;
case 3:
display_books(books, num_books);
break;
case 4:
exit(0);
break;
default:
printf("Invalid Choice\n");
}
}
return 0;
}
OUTPUT
1. Add Book
2. Search Book
3. Display All Books
4. Exit
Enter your choice: 1
Enter book title: Math
Enter author name: Rd_sharma
Enter book ID: 45678
1. Add Book
2. Search Book
3. Display All Books
4. Exit
Enter your choice: 1
Enter book title: science
Enter author name: s.chand
Enter book ID: 23546
1. Add Book
2. Search Book
3. Display All Books
4. Exit
Enter your choice: 3
Book Title: Math
Book Author: Rd_sharma
Book ID: 45678
OUTPUT
Book Title: science
Book Author: s.chand
Book ID: 23546
1. Add Book
2. Search Book
3. Display All Books
4. Exit
Enter your choice: 2
Enter book ID: 45678
Book Title: Math
Book Author: Rd_sharma
Book ID: 45678
1. Add Book
2. Search Book
3. Display All Books
4. Exit
Enter your choice:
CONCLUSION
A library management system is an essential tool for
librarians to effectively manage and operate a library. It helps
to automate and streamline library processes such as
cataloguing, circulation, and reporting, allowing librarians to
spend more time on providing services to patrons. A good
library management system can also improve the overall
experience for patrons by providing them with an easy-to-use
interface to search and request books, and the system's
reporting capabilities can help the library make informed
decisions about their collections and services.
In conclusion, a library management system is a vital
investment for any library looking to improve its operations
and better serve its patrons. The implementation of a new
system can be a complex process, but with the right vendor
and a collaborative effort between library staff and the
vendor, a library management system can greatly improve the
efficiency and effectiveness of the library's operations.