This program allows users to convert temperatures between Celsius, Fahrenheit, and Kelvin. It provides a user-friendly menu-driven interface to select the input temperature scale, enter a temperature value, and choose the desired output scale. The program also includes data validation and advanced features like multi-step conversions.
- Conversion Options:
- Celsius to Fahrenheit and Kelvin.
- Fahrenheit to Celsius and Kelvin.
- Kelvin to Celsius and Fahrenheit.
- Advanced Features:
- Multi-step conversion (e.g., Celsius to Fahrenheit to Kelvin).
- Continuous mode to allow multiple conversions without restarting the program.
- Input Validation:
- Ensures valid temperature values are provided.
- Displays warnings for physically impossible temperatures in certain scales (e.g., temperatures below absolute zero in Kelvin).
-
Menu Options:
- Choose the input scale.
- Enter the temperature value.
- Select the output scale(s) for conversion.
-
Example Usage:
- Input:
Convert 25°C to Fahrenheit and Kelvin. - Output:
25°C = 77°F 25°C = 298.15K
- Input:
- Save the program code in a file named
temperature_conversion.c. - Open a terminal and compile the program:
gcc temperature_conversion.c -o temp_converter
- Run the program:
./temp_converter
Input:
Enter temperature in Celsius: 25
Input:
Enter temperature in Kelvin: 300
-
Main Functionality:
- Displays a menu with input and output options.
- Reads user input and validates it.
- Calls the appropriate conversion function(s).
-
Conversion Functions:
celsiusToFahrenheit()celsiusToKelvin()fahrenheitToCelsius()fahrenheitToKelvin()kelvinToCelsius()kelvinToFahrenheit()
-
Modular Design:
- Each conversion operation is handled by a separate function for clarity and maintainability.
- User input handling and temperature validation are centralized for better error management.
- Add graphical interface for easier interaction.
- Include unit testing for robust validation.
- Support for additional temperature scales (e.g., Rankine).
This project is released under the MIT License.
Feel free to contribute by submitting pull requests or reporting issues.


