Overview:
In general, the term Temperature is a measure of how hot or cold something is; specifically, a measure of the average kinetic energy of the particles in an object, which is a type of energy associated with motion. In this article, I want to introduce you with Temperature. Then I will tell you the unit of the temperature. Then How to convert the Celsius to Fahrenheit? Moreover, I will demonstrate the logic to convert celsius to Fahrenheit. Furthermore, I will write the logic and c program to convert degrees celsius to degrees Fahrenheit. After all, I will explain the resultant output.
Table of contents:
- What is temperature?
- What are the unit of temperature?
- How to convert celsius to fahrenheit?
- Demonstration to convert celsius to fahrenheit
- Main Logic to convert celsius to fahrenheit
- C program to convert celsius to fahrenheit
- Conclusion
What is temperature?
Temperature is a measure of how hot or cold something is; specifically, a measure of the average kinetic energy of the particles in an object, which is a type of energy associated with motion.
What are the unit of temperature?
The SI unit of temperature as per the International System of Units is Kelvin which is represented by the symbol K. However, in most parts of the world, Celsius or Fahrenheit scale is used for measuring temperature.
How to convert celsius to fahrenheit?
To convert Celsius to Fahrenheit, We can use the Temperature conversion formula. Temperature conversion formula from degree Celsius to Fahrenheit is given by:
Demonstration to convert celsius to fahrenheit
Main Logic to convert celsius to fahrenheit
- Step 1: Input temperature in Celsius from user. Store it in some variable say celsius.
- Step 1: Apply formula to convert the temperature to Fahrenheit i.e. fahrenheit = (celsius × 9 / 5) + 32.
- Step 2: Print the value of fahrenheit.
C program to convert celsius to fahrenheit
#include <stdio.h> int main() { float celsius, fahrenheit; /* Input temperature in celsius */ printf("Enter temperature in Celsius: "); scanf("%f", &celsius); /* celsius to fahrenheit conversion formula */ fahrenheit = (celsius * 9 / 5) + 32; printf("%.2f Celsius = %.2f Fahrenheit", celsius, fahrenheit); return 0; }
The output of the Program:
Enter temperature in Celsius: 100 100 Celsius = 212.00 Fahrenheit
Conclusion
To get the output of this Program, User will Enter temperature in Celsius: 100 Then, Compiler will convert it into Fahrenheit automatically. The final output shown onto the screen is as follows:
Enter temperature in Celsius: 100
100 Celsius = 212.00 Fahrenheit