Javatpoint Logo
Javatpoint Logo

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

  1. Define the height of the cone.
  2. Define the radius of the cone.
  3. Calculate the volume of the cone pie x r2 x h/3
  4. 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#




Please Share

facebook twitter google plus pinterest

B.Tech / MCA


Learn Latest Tutorials