Convert degrees. Degrees Celsius can be converted to degrees Fahrenheit. We do this with code written in the C# programming language. It is more convenient to adapt proven code than write the same code again. We compare the results to Google to check them.

Example. Here are some simple methods that perform Celsius and Fahrenheit conversions. You can convert Celsius to Fahrenheit and back again using the constant 5/9. The CLR will compile the expression into a constant.

In this example, we see two static conversion methods. Everything here is nicely stored in a static class because nothing saves state. Double is a type that allows more precision. Degrees may have several digits after the decimal.

Body temperature. If you are reading this, you are a human, so your body temperature should be close to the standard, which is around 98.6 °F. Note that this actually varies between people, so don't be alarmed if it is slightly different.

Summary. We looked at how you can convert temperatures in degrees Celsius and degrees Fahrenheit using methods written in the C# programming language. We tested two methods against Google's conversion function.

And: Scientific applications may need more elaborate methods, but these suffice normally.