Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🌡️ Temperature Converter (C for practice)

A simple and efficient command-line application written in C that converts temperatures between Celsius and Fahrenheit.


📌 Features

  • Convert Celsius → Fahrenheit
  • Convert Fahrenheit → Celsius
  • User-friendly input via terminal
  • Handles invalid input gracefully
  • Uses switch-case and standard C functions

🛠️ Technologies Used

  • C Programming Language

  • Standard Libraries:

    • stdio.h
    • ctype.h

🚀 How It Works

  1. User selects the unit type:

    • C for Celsius
    • F for Fahrenheit
  2. User enters the temperature value

  3. Program performs the conversion

  4. Result is displayed instantly


🔄 Conversion Formulas

  • Celsius to Fahrenheit: F = (C × 9/5) + 32

  • Fahrenheit to Celsius: C = (F − 32) × 5/9


💻 Sample Run

Is the temperature in (F) or (C)?: C
Enter the temperature in Celsius: 25
Temperature in Fahrenheit: 77.0
Is the temperature in (F) or (C)?: F
Enter the temperature in Fahrenheit: 77
Temperature in Celsius: 25.0

⚠️ Error Handling

  • If the user enters an invalid unit:
X is not a valid unit.

📂 Project Structure

temperature-converter/
│── temp.c
│── README.md

🎯 Learning Outcomes

  • Understanding of switch-case
  • Input handling using scanf
  • Use of toupper() for normalization
  • Basic mathematical operations in C
  • Writing clean and readable code

🚀 Future Improvements

  • Add menu-driven interface
  • Support continuous conversions using loops
  • Implement functions for better modularity
  • Add input validation for numeric values

👨‍💻 Author

Sai Suraj


⭐ Acknowledgment

This project is built for practice and learning purposes as part of improving C programming fundamentals.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages