How to Convert Celsius to Fahrenheit Using C#

Submitted by: 
Language: 
Visitors have accessed this post 65 times.

In this tutorial, I will teach you how to convert Celsius to Fahrenheit using c#. This method has the ability to calculate how much Fahrenheit in a given Celsius. The program has a function that, you have to put a Celsius in a textbox and click the button to get the Fahrenheit automatically. Let's begin.

Creating Application

Step 1

Open Microsoft Visual Studio 2015 and create a new windows form application in c#.
figure 1

Step 2

Add a buttons, two texboxes, and two labels after that do the form just like shown below.
figure 2

Step 3

Double click the button and do the following code to convert the Celsius to Fahrenheit.

  1.  
  2. double celsius = 0;
  3. double Fahrenheit = 0;
  4.  
  5. celsius = double.Parse(txtCelsuis.Text);
  6.  
  7. Fahrenheit = (celsius * 9 / 5) + 32;
  8.  
  9. txtFahrenheit.Text = Fahrenheit.ToString();

The complete source code is included. You can download it and run it on your computer.
For any questions about this article. You can contact me @
Email – [email protected]
Mobile No. – 09305235027 – TNT
Or feel free to comment below.


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.