Advertisement
AlphaPenguino

Area of Cylinder

Sep 4th, 2023
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.*;
  2. public class AreaOfCylinder {
  3.    
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.        
  7.         double pi = 3.14159265358979;
  8.        
  9.         System.out.println("Enter Radius");
  10.         double radius = sc.nextDouble();
  11.         double radiusSQRD = radius * radius;
  12.        
  13.         System.out.println("Enter Height");
  14.         double height = sc.nextDouble();
  15.        
  16.         double volume = pi * radiusSQRD * height;
  17.        
  18.        
  19.         System.out.println("The Volume of cylinder is " + volume);
  20.        
  21.        
  22.        
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement