Python Program to Compute Volume and Surface Area of Cone
Write Python Program to Compute Volume and Surface Area of Cone
# Python Program to Compute Volume and Surface Area of Cone
from math import sqrt
PI = 3.14
# get the radius and height of cone
radius = float(input("Enter radius of a cone :--> "))
height = float(input("Enter height of a cone :--> "))
# cone area formula
surface_area = PI * radius * (radius + sqrt(radius * radius + height * height))
# cone volume formula
volume = (1.0/3) * PI * radius * radius * height
print("Surface area of cone :-> ", surface_area)
print("Volume of cone :-> ", volume)
Output:
Enter radius of a cone :--> 5
Enter height of a cone :--> 8
Surface area of cone :-> 226.6135037732887
Volume of cone :-> 209.33333333333334