programming-examples/c-sharp/Conversions/C# Program to Convert Fahrenheit to Celsius.cs

29 lines
657 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Convert Fahrenheit to Celsius
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Celsius
{
class Program
{
static void Main(string[] args)
{
double celsius;
Console.Write("Enter Fahrenheit temperature : ");
double fahrenheit = Convert.ToDouble(Console.ReadLine());
celsius = (fahrenheit - 32) * 5 / 9;
Console.WriteLine("The converted Celsius temperature is" + celsius);
Console.ReadLine();
}
}
}
/*
Output:
Enter Fahrenheit temperature : 95.5
The converted Celsius temperature is35.2777777777778