Mega Code Archive

 
Categories / C# / Data Types
 

Converts Fahrenheit to Celsius

/*      This program converts Fahrenheit to Celsius.       Call this program FtoC.cs.  */    using System;     public class FtoC {     public static void Main() {       double f; // holds the temperature in Fahrenheit      double c; // holds the temparture in Celsius        f = 59.0; // start with 59 degrees Fahrenheit        c = 5.0 / 9.0 * (f - 32.0); // convert to Celsius        Console.Write(f + " degrees Fahrenheit is ");      Console.WriteLine(c + " degrees Celsius.");    }   }