NareshChowdary
progran
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners

. Develop the program calculateCylinderVolume., which accepts radius of a cylinder's base disk and its height and computes the volume of the cylinder.

View Answers

December 13, 2010 at 11:46 AM


Hi Friend,

Try the following code:

import java.util.*;
class CalculateCyliderVolume
{
    public static void main(String[] args) 
    {   
        double PI=3.14;
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Radius: ");
        double r=input.nextDouble();

        System.out.print("Enter Height: ");
        double h=input.nextDouble();

        double volume=PI*r*r*h;
        System.out.println("Volume of Cylinder: "+volume);
        }
}

Thanks









Related Pages:
error in java progran at run time - Java Beginners
error in java progran at run time  Hello sir,,, i make a servlet program in java,,but i face some problem,,so please me.. Actually this type of error are come in my all servlet program My Servlet-- Error
error in java progran at run time - Java Beginners
error in java progran at run time  Hello sir,,, i make a servlet program in java,,but i face some problem,,so please me.. Actually this type of error are come in my all servlet program My Servlet-- Error

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.