Write a program in C# that accepts the temperature in Fahrenheit and converts into Centigrade..
Following is the simple C# code :
Following is the simple C# code :
class Lab { static void Main(string[] args) { int tempInCelsius, tempInFaren; Console.WriteLine("Enter the Temperature in Fahrenheit is(°F): "); tempInFaren = int.Parse(Console.ReadLine()); tempInCelsius = (tempInFaren - 32) * 5 / 9; Console.WriteLine("Temperature in Celsius(°C) : " + tempInCelsius); Console.ReadLine(); } }
Output:-
No comments:
Post a comment