fork download
  1. /* package whatever; // don't place package name! */
  2. import java.io.*;
  3. /* Name of the class has to be "Main" only if the class is public. */
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. System.out.println("The Java Volume Of A Sphere Program.");
  9. double p = 3.14;
  10. int radi = 12;
  11. double multi = 1.3331;
  12. double volume = Math.pow(12,3) * (p) * (multi);
  13. double volume2 = Math.round(volume);
  14. System.out.println(p + " " + radi + " " + multi);
  15. System.out.println("The Volume Of A Sphere " + volume2);
  16. }
  17. }
Success #stdin #stdout 0.16s 60408KB
stdin
1
2
10
42
11
stdout
The Java Volume Of A Sphere Program.
3.14 12 1.3331
The Volume Of A Sphere 7233.0