77
Program to find the volume of the cone
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)
Solution
C Program
Output:
Volume of the cone=48766.666667
PHP Program
Output:
The volume of the cone=48766.666666711
Java Program
Output:
Volume of the cone=48766.666666711004
C# Program
Output:
Volume of cone=48766.666666711
Python Program
Output:
Volume of cone=48766.666666711
Next Topic#