An open API service indexing awesome lists of open source software.

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.

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:

initial menu

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

temperature menu

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

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/)