displays a conversion table of Fahrenheit to Celsius : int : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » int »

 

displays a conversion table of Fahrenheit to Celsius









    

/*  
   This program displays a conversion  
   table of Fahrenheit to Celsius. 
 
   Call this program FtoCTable.cs. 
*/  
 
using System; 
 
public class FtoCTable {  
  public static void Main() {  
    double f, c; 
    int counter; 
 
    counter = 0; 
    for(f = 0.0; f < 100.0; f++) { 
      c = 5.0 / 9.0 * (f - 32.0); // convert to Celsius 
      Console.WriteLine(f + " degrees Fahrenheit is " + 
                        c + " degrees Celsius."); 
 
      counter++; 
 
      // every 10th line, print a blank line        
      if(counter == 10) { 
        Console.WriteLine(); 
        counter = 0; // reset the line counter 
      } 
    } 
  }  
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» int