calculate the volume of a cylinder.

Share code with your friends

Share on whatsapp
Share on facebook
Share on twitter
Share on telegram


					import java.util.Scanner;
public class volumeOfCylinder
    public static void main(String args[])  
        Scanner sc=new Scanner(;
        System.out.println("Enter radius of cylinder");
        double radius=sc.nextDouble();
        System.out.println("Enter height of cylinder");
        double height=sc.nextDouble();
        double pi=22/7;  
        double volume=pi*(radius*radius)*height;  
        System.out.println("Volume of the cylinder="+volume);  


Coding Store

Leave a Reply

Your email address will not be published. Required fields are marked *