Hey guys!
This is a beginner-friendly Currency Converter project made completely in C. The main goal of this project was to practice core programming concepts while also building something useful and interactive. The converter supports more than 150 world currencies and allows users to convert values easily by entering inputs like 100 USD and converting them into another currency like INR, EUR, JPY, etc.
This project was built mainly using basic C concepts such as arrays, loops, conditional statements, string handling, user input, and simple mathematical calculations. Instead of using APIs or online exchange-rate services, all exchange rates used in this project are manually added. Because of that, the rates may differ slightly from real-world values and should not be considered financially accurate. The project is mainly for educational and learning purposes.
While learning C programming, I wanted to create something bigger than simple calculator programs or small logic-based questions. Most beginner projects focus only on a few concepts at a time, but I wanted to combine multiple concepts together into a single practical project.
The idea of a currency converter seemed interesting because:
- It involves handling lots of data
- It uses arrays efficiently
- It requires searching and matching strings
- It includes user interaction
- It performs real calculations
- It feels like a real-world utility program
This project also helped me understand how large datasets can be managed in C using arrays and indexing systems.
-
Supports 150+ currencies from around the world
-
User-friendly input system
-
Allows input like:
100 USD -
Converts into another selected currency
-
Uses string comparison with
strcmp() -
Uses arrays to store currency names and exchange rates
-
Fast conversion calculations
-
Beginner-friendly code structure
-
Console-based interface
-
Lightweight and simple
Enter amount and currency: 100 EUR
Convert to: INR
100.00 EUR = 10300.00 INR
Another example:
Enter amount and currency: 50 USD
Convert to: JPY
50.00 USD = 7661.29 JPY
This project helped me practice many important C programming concepts, including:
Arrays are heavily used in this project to store:
- Currency codes
- Exchange rates
Example:
char currency[][5] = {"USD", "EUR", "INR"};
float rate[] = {95.00, 103.00, 1.00};The indexes of both arrays are connected.
For example:
currency[0] = USD
rate[0] = 95.00
So the program knows:
USDcorresponds to95.00
The project uses:
strcmp()- character arrays
- string input using
%s
This allows users to type currency names directly like:
USD
EUR
INR
instead of typing indexes manually.
Loops are used to:
- search currencies
- display data
- process conversions
Example:
for(int i = 0; i < 157; i++)
{
if(strcmp(from, currency[i]) == 0)
{
fromIndex = i;
}
}The conversion formula used is:
result = amount * rate[fromIndex] / rate[toIndex];This works because all rates are stored relative to INR.
While building this project, I faced multiple issues and bugs such as:
- incorrect input handling
- garbage values
- invalid indexes
- string comparison errors
- wrong conversions
- uninitialized variables
One of the biggest problems was understanding how to map currency names like USD to their correct array indexes. Learning about indexes and array relationships helped solve that issue.
Another challenge was taking combined input like:
100 USD
instead of asking separately for amount and currency. This was solved using:
scanf("%f %s", &amount, from);This project helped me improve my understanding of:
- arrays
- string manipulation
- loops
- debugging
- user input handling
- indexing systems
- problem solving
It also gave me confidence in building larger C projects instead of only basic programs.
Some features I may add in the future:
- Real-time exchange rates using APIs
- GUI interface
- File handling
- Better error handling
- Lowercase currency support
- Currency full-name support (
dollar,euro, etc.) - More accurate exchange rates
- Menu-driven interface
- Sorting and searching optimizations
- C Programming Language
- Standard Libraries:
stdio.hstring.h
This project is made mainly for learning and practice purposes. Exchange rates are manually added and may not match current real-world market values exactly.
APD ARKA
Thanks for checking out this project!
Feel free to explore, modify, improve, or use it for learning purposes :)