![]() |
We are going to see JavaScript Program to Find the Volume of Cylinder. We use direct formula to calculate volume of cylinder. A cylinder is a three-dimensional geometric shape that consists of two parallel circular bases connected by a curved surface. Formula usedV = πr2h where:
ApproachWe will create a function and pass radius and height as parameter. Calculate the volume of the cylinder using the formula. Return the calculated volume Example: This example shows the finding the volume of cylinder using direct formula.
Output Volume of the cylinder is : 785.3981633974483 Time Complexity: O(1) Space Complexity: O(1) |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |