Advertisement
Guest User

F to C

a guest
Jan 21st, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  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 Fehrenheit");
  10. f = sc.nextDouble();
  11. c = (f - 32)*5/9;
  12. System.out.println("That's " + c + " degrees Celsius.");
  13. }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement