80
Program to find the volume of the cylinder
A cylinder can be defined as the solid 3D object having two circular faces connected with the rectangular surface. The volume of the cylinder is the amount of space contained by it. The formula to calculate the volume of the cylinder is given below.
Formula
V=pie x r2 x h
where,
r is the radius of the cylinder
h is the height of the cylinder
V is the volume of the cylinder
Algorithm
- Define the height of the cylinder.
- Define the radius of the cylinder.
- Calculate the volume of the cylinder pie x r2 x h
- Define volume_cylinder and assign the volume of the cylinder to it.
Complexity
O(1)
Solution
C Program
Output:
Volume of the cylinder=146300.000000
PHP Program
Output:
Volume of the cube=146300.00000013
Java Program
Output:
Volume of the cylinder=146300.000000133
C# Program
Output:
Volume of cylinder=146300.000000133
Python Program
Output:
volume of the cube=146300.000000133
Next Topic#