A console-based Inventory Management System implemented in C, demonstrating the use of Array, Stack, and Queue data structures to manage products, record updates, and process customer orders efficiently.
This project simulates a basic inventory management workflow for a small business or warehouse.
It allows users to:
- Add or update product quantities
- View the entire inventory
- Undo the last stock update
- Add customer orders to a processing queue
- Process orders in a first-in-first-out manner
This project highlights the application of multiple data structures to solve practical, real-world problems.
- Add / Update Products: Add new products or restock existing items.
- Undo Functionality: Reverse the most recent update using a stack (LIFO).
- Order Queue: Manage customer orders in FIFO order.
- Display Inventory: View current stock levels for all products.
- Modular Structure: Each operation is implemented as a separate function.
| Data Structure | Role in the System |
|---|---|
| Array | Stores product details such as name and quantity. |
| Stack | Records update history to allow Undo operations. |
| Queue | Manages and processes orders sequentially. |
Inventory (Array) ├──> Stack → Undo last update (LIFO) └──> Queue → Process orders (FIFO)
This structure allows efficient product tracking, order handling, and rollback of stock changes.
-
Clone the Repository
git clone https://github.com/<your-username>/inventory-management-c.git
-
Navigate to the Project Directory
cd inventory-management-c -
Compile the Code
gcc inventory_management.c -o inventory
-
Run the Program
./inventory
When you run the program, you will see a text-based menu:
===== Inventory Management System =====
1. Add/Update Product
2. Display Inventory
3. Undo Last Update
4. Add Order
5. Process Order
6. Exit
- Option 1: Enter the product name and quantity to add or update inventory.
- Option 2: Display the list of all available products with current stock levels.
- Option 3: Undo the most recent inventory update (restores previous quantity).
- Option 4: Enter the product name and quantity to place a new order (added to queue).
- Option 5: Process the earliest order from the queue.
- Option 6: Exit the application.
- Add a new product: “Laptop 10”
- Update the product: Add 5 more units
- Undo last update: Revert to previous stock (10 units)
- Add an order: Laptop, Quantity 3
- Process order: Inventory reduces from 10 to 7 units
inventory-management-c/
├── inventory_management.c # Main source code
├── README.md # Documentation
└── sample_output.txt # (Optional) Example terminal output
- Implement file handling to store and load data persistently.
- Add product search, delete, and sorting functionalities.
- Include low-stock alerts and restock suggestions.
- Develop a graphical user interface (GUI) using C++, Python, or Java.
- Integrate a database such as MySQL or SQLite.
- Add reporting and analytics (sales, restock trends).
- Jaineel Patel
- Vaibhav Rathod
- Rudranch Singh
- Applied multiple data structures in a single project.
- Developed understanding of stack (LIFO) and queue (FIFO) operations.
- Practiced modular programming and structured code design in C.
- Improved problem-solving and debugging skills through implementation.
The Inventory Management System demonstrates how arrays, stacks, and queues can work together to form a robust and efficient product management application. It serves as a foundation for larger-scale inventory or warehouse management systems, combining theory with practical implementation.
Developed as part of the Data Structures Mini Project (Internal Assessment 2).