Enter the Temperature in Celsius (°C) : 20 Temperature in Fahrenheit(°F) is : 68
This is a C# Program to perform celsius to fahrenheit conversion.
This C# Program Performs Celsius to Fahrenheit Conversion.
Here the temperature is obtained in Celsius and is converted to Fahrenheit.
Here is source code of the C# program to perform Celsius to Fahrenheit conversion. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
/* * C# Program to Perform Celsius to Fahrenheit Conversion */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace program { class Program { static void Main(string[] args) { int celsius, faren; Console.WriteLine("Enter the Temperature in Celsius(°C) : "); celsius = int.Parse(Console.ReadLine()); faren = (celsius * 9) / 5 + 32; Console.WriteLine("0Temperature in Fahrenheit is(°F) : " + faren); Console.ReadLine(); } } }
In this C# program, we are reading the temperature in celsius(°c) using ‘celsius’ variable. Multiply the value of ‘Celsius’ variable with 9 and add the resulted value with the value of 5. Again add the resulted value with the value of 32. Print the Fahrenheit value of the celsius.
Enter the Temperature in Celsius (°C) : 20 Temperature in Fahrenheit(°F) is : 68