# C# Program to Convert Celsius to Fahrenheit

This is a C# Program to perform celsius to fahrenheit conversion.

Problem Description

This C# Program Performs Celsius to Fahrenheit Conversion.

Problem Solution

Here the temperature is obtained in Celsius and is converted to Fahrenheit.

Program/Source Code

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) : ");
faren = (celsius * 9) / 5 + 32;
Console.WriteLine("0Temperature in Fahrenheit is(°F) : " + faren);

}
}
}```
Program Explanation

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.

Runtime Test Cases
```
Enter the Temperature in Celsius (°C) :  20
Temperature in Fahrenheit(°F)  is  : 68```

Sanfoundry Global Education & Learning Series – 1000 C# Programs.

If you wish to look at all C# Programming examples, go to 1000 C# Programs.

If you find any mistake above, kindly email to [email protected]