The cone can be defined as the three dimensional object with a circular base. The volume of the cone is measured in cubic units. Be sure that all of the measurements are in the same unit before computing the volume.
Formula
volume of cone= pie x r2 x h/3
Algorithm
- Define the height of the cone.
- Define the radius of the cone.
- Calculate the volume of the cone pie x r2 x h/3
- Define volume_cone and assign the volume of the cone to it.
Complexity
O(1)
Input:
Radius = 38, Height = 35, Pie = 3.14
Output:
Volume = pie * radius * radius * height/3;
= 3.14 * 38 * 38 * 35/3
= 48766.666667
C Program
Output:
PHP Program
Output:
Java Program
Output:
C# Program
Output:
Python Program
Output: