วันอาทิตย์ที่ 13 พฤศจิกายน พ.ศ. 2554

java แปลง Celsius To Fahrenhei

แปลง CelsiusToFahrenhei

public class CelsiusToFahrenhei
{
 public static void main(String[] args) {
  double celsius = 37.77; // Say 37 ;
  double fahrenheit = ((9 / 5.0) *  celsius + 32);
  System.out.println(" Celsius " +  celsius  + " is " +
  fahrenheit + "in Fahrenheit ");
  }
 }


แปลง FahrenheiToCelsius
public class FahrenheiToCelsius
{
 public static void main(String[] args) {
  double fahrenheit = 100; // Say 100 ;
  double celsius = (5.0 / 9) * (fahrenheit - 32);
  System.out.println("Fahrenheit " + fahrenheit  +
  celsius + "in Celsius ");
  }
 }

ไม่มีความคิดเห็น:

แสดงความคิดเห็น