https://github.com/sandra1me/c-unit-converter
This is a command-line program written in C that allows you to convert between different types of physical units: temperature, distance, pressure, weight, and volume. It is a simple and educational tool that demonstrates the use of control structures, functions, and input validation in C.
https://github.com/sandra1me/c-unit-converter
beginner-project c command-line-tool console-application control-structures conversion-tool distance-conversion educational functions-in-c input-validation pressure-conversion temperature-conversion unit-converter volume-conversion weight-conversion
Last synced: 9 months ago
JSON representation
This is a command-line program written in C that allows you to convert between different types of physical units: temperature, distance, pressure, weight, and volume. It is a simple and educational tool that demonstrates the use of control structures, functions, and input validation in C.
- Host: GitHub
- URL: https://github.com/sandra1me/c-unit-converter
- Owner: Sandra1me
- License: mit
- Created: 2025-08-07T12:30:02.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-03T17:28:53.000Z (9 months ago)
- Last Synced: 2025-09-03T19:32:11.240Z (9 months ago)
- Topics: beginner-project, c, command-line-tool, console-application, control-structures, conversion-tool, distance-conversion, educational, functions-in-c, input-validation, pressure-conversion, temperature-conversion, unit-converter, volume-conversion, weight-conversion
- Language: C
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unit Converter (C)
This is a command-line program written in C that allows you to convert between different types of physical units: temperature, distance, pressure, weight, and volume. It is a simple and educational tool that demonstrates the use of control structures, functions, and input validation in C.
## Compilation
You can compile the program using `gcc`:
```c
gcc conversor.c -o conversor
```
## Usage
After compiling, run the program from your terminal:
```c
./conversor
```
An interactive menu like this will appear:

After choosing the type of conversion, a submenu will appear with the available conversion options. For example, for temperature:

The program will ask you for a value to convert and will display the result.
## Features
- Temperature conversion: ºC ↔ ºF
- Distance conversion: km ↔ miles, m ↔ ft
- Pressure conversion: Pa ↔ atm
- Weight conversion: kg ↔ lb
- Volume conversion: L ↔ gal
- Conversion loop: repeat as many times as the user wants
- Input validation: handles invalid numbers and menu options gracefully
## Sample Output

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](https://choosealicense.com/licenses/mit/)