#include<stdio.
h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
struct library
char name[100], course[100], decide[10], decide2[10];
float fine;
char sub[100],date[100];
int ch, temp, count;
};
void details(struct library *lib);
void choice(struct library *lib);
void issue(struct library *lib);
void details(struct library *lib)
lib->count = 0;
while (1)
printf("\n Enter Subject : ");
scanf("%s", lib->sub);
if (strcmp(lib->sub, "economics") == 0 || strcmp(lib->sub, "Economics") == 0) {
printf("\n List of %s Books : \n", lib->sub);
printf("\n 1. Economics in Daily Life \n");
printf("\n 2. MODERN Economics \n");
printf("\n 3. MACRO Economics \n");
printf("\n 4. MICRO Economics \n");
printf("\n Enter your choice : ");
scanf("%d", &lib->ch);
else
if (strcmp(lib->sub, "physics") == 0 || strcmp(lib->sub, "Physics") == 0) {
printf("\n List of %s Books : \n", lib->sub);
printf("\n 1. Quantum Mechanics \n");
printf("\n 2. Principles of Physics \n");
printf("\n 3. MODERN PHYSICS \n");
printf("\n 4. PHYSICS AROUND US \n");
printf("\n Enter your choice : ");
scanf("%d", &lib->ch);
else
if (strcmp(lib->sub, "chemistry") == 0 || strcmp(lib->sub, "Chemistry") == 0)
printf("\n List of %s Books : \n", lib->sub);
printf("\n 1. Chemical Reactions And Equations \n");
printf("\n 2. Inorganic Chemistry \n");
printf("\n 3. Organic Chemistry \n");
printf("\n 4. Surface Chemistry \n");
printf("\n Enter your choice : ");
scanf("%d", &lib->ch);
else
if (strcmp(lib->sub, "maths") == 0 || strcmp(lib->sub, "Maths") == 0) {
printf("\n List of %s Books : \n", lib->sub);
printf("\n 1. Number System \n");
printf("\n 2. Calculas \n");
printf("\n 3. Complex System \n");
printf("\n 4. Permutations and Combinations \n");
printf("\n Enter your choice : ");
scanf("%d", &lib->ch);
else {
printf("\n Entered Subject is NOT Available \n");
continue;
choice(lib);
printf("\n Do you wish to issue ? ");
scanf("%s", lib->decide);
if (strcmp(lib->decide, "yes") == 0 || strcmp(lib->decide, "Yes") == 0)
lib->count++;
printf("\n Do you wish to issue any other book ? ");
scanf("%s", lib->decide2);
if (strcmp(lib->decide2, "yes") == 0 || strcmp(lib->decide2, "Yes") == 0)
continue;
else
issue(lib);
break;
void choice(struct library *lib) {
if (strcmp(lib->sub, "economics") == 0 || strcmp(lib->sub, "Economics") == 0)
switch (lib->ch) {
case 1:
printf("\n Author = A. James \n ");
printf("\n Year of Publish = 1979 \n");
break;
case 2:
printf("\n Author = B. Frank \n ");
printf("\n Year of Publish = 1982 \n");
break;
case 3:
printf("\n Author = C. Dino \n ");
printf("\n Year of Publish = 2001 \n");
break;
case 4:
printf("\n Author = D. Ross \n ");
printf("\n Year of Publish = 1999 \n");
break;
else if (strcmp(lib->sub, "physics") == 0 || strcmp(lib->sub, "Physics") == 0) {
switch (lib->ch) {
case 1:
printf("\n Author = E. Robert \n ");
printf("\n Year of Publish = 2003 \n");
break;
case 2:
printf("\n Author = F. Arthur \n ");
printf("\n Year of Publish = 1987 \n");
break;
case 3:
printf("\n Author = G. Frich \n ");
printf("\n Year of Publish = 1995 \n");
break;
case 4:
printf("\n Author = R. Frost \n ");
printf("\n Year of Publish = 2007 \n");
break;
else if (strcmp(lib->sub, "chemistry") == 0 || strcmp(lib->sub, "Chemistry") == 0)
switch (lib->ch)
case 1:
printf("\n Author = S. Harper \n ");
printf("\n Year of Publish = 1981 \n");
break;
case 2:
printf("\n Author = H. Mcmahon \n ");
printf("\n Year of Publish = 2000 \n");
break;
case 3:
printf("\n Author = W. White \n ");
printf("\n Year of Publish = 2008 \n");
break;
case 4:
printf("\n Author = M. Dian \n ");
printf("\n Year of Publish = 2003 \n");
break;
else if (strcmp(lib->sub, "maths") == 0 || strcmp(lib->sub, "Maths") == 0)
{
switch (lib->ch) {
case 1:
printf("\n Author = L. Walter \n ");
printf("\n Year of Publish = 2005 \n");
break;
case 2:
printf("\n Author = P. Need \n ");
printf("\n Year of Publish = 1975 \n");
break;
case 3:
printf("\n Author = K. Sirac \n ");
printf("\n Year of Publish = 2001 \n");
break;
case 4:
printf("\n Author = C. Robin \n ");
printf("\n Year of Publish = 2008 \n");
break;
void issue(struct library *lib)
printf("\n Enter Name of Student : ");
scanf("%s", lib->name);
printf("\n Enter Course of Student : ");
scanf("%s", lib->course);
printf("\n Date of Issue : ");
time_t now = time(0);
struct tm *ptr = localtime(&now);
printf("%d / %d / %d\n", ptr->tm_mday, 1 + ptr->tm_mon, 1900 + ptr->tm_year);
}
int main()
clrscr();
printf("\n \t \t \t WELCOME TO ABC LIBRARY \n ");
printf("\n ******************************************************************* \n");
struct library lib;
//[Link]=0;
details(&lib);
printf("\n Total Books Issued = %d\n", [Link]);
printf("\n RETURN AFTER 2 MONTHS... \n ");
printf("\n Date of Return : ");
time_t now = time(0);
struct tm *ptr = localtime(&now);
printf("%d / %d / %d\n", ptr->tm_mday, 3 + ptr->tm_mon, 1900 + ptr->tm_year);
printf("\n IF NOT RETURNED, Fine @ 10/- per day will be charged \n");
printf("\n THANK YOU !! ");
getch();
//return 0;
OUTPUT:
Enter your choice:1
Author=[Link]
Year of Publish=1979
Do you wish to issue?yes
Do you wish to issue any other book?no
Enter Name of Student:simran
Enter Course of Student:bca
Date of Issue:22/7/2025
Total Books Issued=1
RETURN AFTER 2 MONTHS...
Date of Return:22/9/2025
IF NOT RETURNED,Fine@10/- per day will be charged
THANK TOU!!