fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.Scanner;
  4. import java.io.*;
  5.  
  6. /* Name of the class has to be "Main" only if the class is public. */
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. Scanner reader = new Scanner(System.in);
  12. double fahrenheit;
  13. double celcius;
  14.  
  15. System.out.println("Enter degrees Celcius: ");
  16. celcius = reader.nextDouble();
  17.  
  18. fahrenheit = (celcius* 9.0 /5.0 + 32.0);
  19. System.out.println("Celcius entered is " + celcius);
  20. System.out.println("The temperature in fahrenheit is ");
  21. System.out.println(fahrenheit);
  22.  
  23. }
  24. }
Success #stdin #stdout 0.08s 4386816KB
stdin
100
stdout
Enter degrees Celcius: 
Celcius entered is 100.0
The temperature in fahrenheit is 
212.0