Before writing the program of calculating the volume of cone in different programming languages, firstly we have to know about what is cone and what is the formula to find volume of it?
What is Cone?
A cone is a 3-D geometric shape. This shape consist the base of circle shape and the curved surface pointing towards top.
Volume of Cone is the total space acquired by the cone.
Volume of Cone = 1/3(pi * r * r * h)
Where, r is the radius, h is the height and value of pi is 3.14
Program of calculating the volume of a cone in different Programming languages
Program 1: Write a Program in C language:
Output of Above C program:
Program 2: Write a Program in Java language:
Output of Above Java program:
Program 3: Write a Program in PHP programming language.
Output of Above PHP program:
Program 4: Write a Program in Python programming language.
Output of Above Python program: