Convert celsius to farenheit
Algorithm
Input Temperature in Celsius. Output Temperature in Fahrenheit. complexity O(1) CelsiustoFahrenheit(Tc) 1 Tf = (9/5)*Tc+32; 2 print Tf.
Algorithm Description
Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit.
C Code
//To convert the temperature from Celsius to Fahrenheit
//Input : Enter any integer
#include< stdio.h>
#include< conio.h>
int main()
{
int cel;
float fah;
printf("Enter temperature in Celsius to be converted to Fahrenheit ");
scanf("%d",&cel);
fah=(float)(9/5)*(cel)+ 32;
printf("Temperature in Celsius is %f",fah);
}