Computer Science, asked by mehreenwania, 6 months ago

Write a algorithm, draw a flowchart and write a program in Java to find out the volume of the cylinder and display the result (v = pie r2 h). Also write the variable list​

Answers

Answered by Anonymous
3

Answer:

Algorithm

  1. Define the height of the cylinder.
  2. Define the radius of the cylinder.
  3. Calculate the volume of the cylinder pie x r2 x h
  4. Define volume_cylinder and assign the volume of the cylinder to it.

Program:

public class cylinder

{

public static void main(String args[])

{

int height=38;

int radius=35;

double pie=3.14285714286;

double volume=pie*(radius*radius)*height;

System.out.println("Volume of the cylinder="+volume);

}

}

Output:

Volume of the cylinder = 146300.000000133

Similar questions