Answers for "c# code to calculate fahrenheit to celsius"

C#
0

Celsius to Fahrenheit c#

private static void CelsiusToFahrenheit(double celsius)
{
    var fahrenheit = Math.Round((celsius * 1.8) + 32, 2);
  	Console.WriteLine($"{fahrenheit}°F");
}

// CelsiusToFahrenheit(0); output 32°F
// CelsiusToFahrenheit(20); output 68°F
// CelsiusToFahrenheit(30); output 86°F
Posted by: Guest on June-25-2020
0

fahrenheit to celsius c#

private void FahrenheitToCelsius(double fahrenheit)
{
    var celsius = Math.Round((fahrenheit - 32) * 5 / 9, 2);
    Console.WriteLine($"{celsius}°C");
}

// FahrenheitToCelsius(60); output 15.56°C
// FahrenheitToCelsius(77); output 25°C
// FahrenheitToCelsius(89); output 31.67°C
Posted by: Guest on June-25-2020

Code answers related to "c# code to calculate fahrenheit to celsius"

C# Answers by Framework

Browse Popular Code Answers by Language