SHARE
TWEET

Degrees to Celsius converter

Gauge1417 Jan 22nd, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Program {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7.         double f,c;
  8.         Scanner sc = new Scanner(System.in);
  9.         System.out.println("Enter a temperature in Degrees Farenheit");
  10.         f = sc.nextDouble();
  11.        
  12.         c = (f - 32) * 5/9;
  13.        
  14.         System.out.println("That's " + c +  " Degrees Celcius" );
  15.     }
  16.  
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top