[38523 views]
Celsius and Fahrenheit are two important scales to measure temperature. These are two important units of the temperature scale. The temperature in the centigrade scale is expressed in degrees Celsius. The temperature in the Celsius scale is denoted by °C. The temperature in the Fahrenheit scale is expressed in degrees Fahrenheit. The temperature in the Fahrenheit scale is denoted by °F. The relationship between these two scales is:
(9/5)*C=F-32
Therefore, the formula to convert a given temperature from Celsius scale to Fahrenheit scale is:
F=(9/5)*C+32
We will use this formula to convert a given temperature from Celsius scale to Fahrenheit scale.
For example:
Temperature in Celsius scale = 25 °C
F=((9/5)×25)+32 F=77Equivalent temperature in Fahrenheit scale = 77.0 °F
In this article, we will understand the algorithm and flowchart to convert a given temperature from Celsius scale to Fahrenheit scale.
We can covert a given temperature form Celsius to Fahrenheit using the formula: f = ((5/9) * cel ) + 32. In this algorithm, we will start off by taking the temperature to be convert into Fahrenheit as user input. This value is stored in a variable, say ‘cel’. We now initialize the temperature in Fahrenheit as 0, for further calculation purpose. Now, we will use the appropriate formula. Temperature in Fahrenheit is calculated by performing: f = ((5/9) * cel ) + 32. This value is displayed to the user.
Example:
Let us consider the temperature 20 °C:
cel = 20
(9/5) * 20 = 36
36 + 32 = 68
Therefore, f = 68 °F.
Let us consider the temperature 80 °C:
cel = 80
(9/5) * 80 = 144
144 + 32 = 176
Therefore, f = 176 °F.