Convert Fahrenheit to celsius using double type - C++ Data Type

C++ examples for Data Type:double

Description

Convert Fahrenheit to celsius using double type

Demo Code

#include <iostream>
using namespace std;
int main()//from   ww  w . j  a  v a  2 s . c  o m
{
   double fahren, celsius;
   cout << "Enter a temperature in degrees Fahrenheit: ";
   cin  >> fahren;
   celsius = (5.0/9.0) * (fahren - 32.0);
   cout << "The equivalent Celsius temperature is " << celsius << endl;
   return 0;
}

Result


Related Tutorials