Saturday, 1 March 2014

Convert temperature from centigrade to Fahrenheit.



     Convert temperature from centigrade to Fahrenheit.
Description:

To convert Centigrade to Fahrenheit, multiply by 1.8 and add 32 degrees.

Algorithm:  

Step 1 : start
Setp 2 : read temperature in centrigrade
Step 3 : caluculate Fahrenheit = 32 + (centigrade * (1.8));
Step 4 : display centigrade and Fahrenheit
Step 5 : stop





Program


#include<stdio.h>

main ()
{
float temp_c, temp_f;
printf ("Enter the value of Temperature in Celcius: ");

scanf ("%f", &temp_c);

temp_f = (1.8 * temp_c) + 32;

printf ("The value of Temperature in Fahreinheit is: %f", temp_f);

}

No comments: