C# How To Convert Celsius to Fahrenheit
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;
Console.WriteLine(celsius + " Celsius is " + fahrenheit + " Fahrenheit");
Explanation:
The formula is F = C * 9 / 5 + 32.
We use double instead of int, so the decimals are kept, and temperatures like 36.6 are also converted correctly.
Related Pages
C# Operator Precedence Tutorial