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 Cylinder.");
  9. double p = 3.14;
  10. int radi = 12;
  11. int height = 12;
  12. double volume = Math.pow(12,2) * (p) * (height);
  13. System.out.println(p + " " + radi + " " + height);
  14. double volume2 = Math.round(volume);
  15. System.out.println("The Volume Of A Cyliinder Is: " + volume2);
  16. }
  17. }
Success #stdin #stdout 0.16s 60196KB
stdin
1
2
10
42
11
stdout
The Java Volume Of A Cylinder.
3.14 12 12
The Volume Of A Cyliinder Is: 5426.0