Latest Post

Sunday, 1 January 2017

How to Convert Centigrade into Fahrenheit [C#]

Write a program in C# that accepts the temperature in Centigrade and converts into Fahrenheit..

Following is the simple C# code :

class Lab
    {
        static void Main(string[] args)
        {

            int tempInCelsius, tempInFaren;
            Console.WriteLine("Enter the Temperature in Celsius(°C) : ");
            tempInCelsius = int.Parse(Console.ReadLine());
            tempInFaren = (tempInCelsius * 9) / 5 + 32;
            Console.WriteLine("Temperature in Fahrenheit is(°F) : " + tempInFaren);
            Console.ReadLine();

        }
}
Output:-



Government Jobs