fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. // TODO code application logic here
  14. Scanner input=new Scanner(System.in);
  15. double num1,num2,num3;
  16.  
  17. System.out.println("Enter the num1");
  18. num1=input.nextDouble();
  19.  
  20.  
  21. System.out.println("Enter the num2");
  22. num2=input.nextDouble();
  23.  
  24. System.out.println("Enter the num3");
  25. num3=input.nextDouble();
  26.  
  27. Math.max(num1,num2);
  28. System.out.println("the greatest number is:"+ Math.max( Math.max(num1,num2),num3));
  29.  
  30. }
  31. }
Success #stdin #stdout 0.15s 55828KB
stdin
5
6
7
stdout
Enter the num1
Enter the num2
Enter the num3
the greatest number is:7.0