A terminal-based pharmacy management application written in C.
This project manages medicine inventory, customer purchases, receipts, and sales reports using file-based persistence.
pharmacy_management.c— main source code.inventory.txt— stores medicine ID, name, price, and stock.members.txt— Membership holder customers list.sales.txt— logs every sale for reporting.Receipt_<customer>.txt— one receipt file is created per purchase.
- View all medicines and current stock
- Search medicines by ID or name
- Purchase multiple medicines in one visit
- Apply membership discount and bulk discount
- Generate and save receipts
- Restock inventory
- Generate sales reports with best-selling medicine, top customer, and daily/monthly totals
Compile with GCC:
gcc -o pharmacy pharmacy_management.cRun the program:
./pharmacy- Inventory persists between runs via
inventory.txt. - Membership discounts are validated against
members.txt. - A 10% bulk discount applies when the subtotal exceeds 5000.
- VAT of 5% is applied after discounts.
- To reset stock and sales data, delete
inventory.txtandsales.txt.