Volume of a Cone

Published by Mubashir Hassan in

Create a function that takes the height and radius of a cone as arguments and returns the volume of the cone rounded to the nearest hundredth.

Volume of a Cone Image

Examples

coneVolume(3, 2) ➞ 12.57

coneVolume(15, 6) ➞ 565.49

coneVolume(18, 0) ➞ 0

Notes

  • See the resources tab for the formula.
  • Return after rounding the answer to two decimal places.
  • If the cone has no volume, return 0.00.
Watch a quick demo on how Edabit works.