TempConv.java

Aim:
To find Temperature Conversion (Fahrenheit to Celsius)

Source code:
import java.lang.*;
import java.util.*;
class TempConv
 {
  public static void main(String args[]) 
  {
    double f,c;
    Scanner input=new Scanner(System.in);
    System.out.println("Enter Fahrenheit value");
    f=input.nextDouble();
    c=((f- 32)*5)/9;
    System.out.println("Fahrenheit to Celsius value="+c);
   }
 }
    
Output:
Enter Fahrenheit value
100
Fahrenheit to Celsius value=37.77777777777778

 

No comments:

Post a Comment