Write a program to calculate area and volume of Sphere.
Area of Sphere = 4 π r 2
Volume of Sphere = 4/3 π r 3
Code
print("Enter the radius of the sphere")radius = float(input("Radius: "))area = 4 * 3.14 * radius * radiusvolume = 4 / 3 * 3.14 * radius * radius * radiusprint("The area of the sphere is", area)print("The volume of the sphere is", volume)
0 Comments
Post a Comment