C++ How To Convert Celsius to Fahrenheit
Convert Celsius to Fahrenheit
To convert Celsius to Fahrenheit, multiply by 9, divide by 5, and add 32:
Example
double celsius = 25;
double fahrenheit = celsius * 9 / 5 + 32;
cout << celsius << " Celsius is " << fahrenheit << " Fahrenheit";
Explanation:
The formula is F = C * 9 / 5 + 32.
We use double instead of int, so temperatures with decimals, like 36.6, are also converted correctly.