converts Fahrenheit to Celsius

image_pdfimage_print

   
 
/*  
   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."); 
  }  
}


           
         
     


This entry was posted in Data Types. Bookmark the permalink.