programming-examples/c++/Others/Fahrenheit to celsius conversion.cpp
2019-11-15 12:59:38 +01:00

15 lines
301 B
C++

Fahrenheit to celsius conversion
#include <iostream.h>
int main()
{
double fahr , celsius;
cout<<"Enter the temperature in degrees fahrenheit: ";
cin>>fahr;
//convert to celsius
celsius = (5.0 / 9.0) * (fahr - 32.0);
cout<<"The temperature in celsius is "<<celsius<<endl;
return 0;
}