How to calculate the surface area of cylinder in Node.js

1 Answer

0 votes
const radius = 7;
const height = 18;
  
const cylinder_surface_area1 = (2 * Math.PI * radius * height) + (2 * Math.PI * (radius * radius));
  
const cylinder_surface_area2 = 2 * Math.PI * radius * (radius + height);
  
console.log("Cylinder Surface Area = " + cylinder_surface_area1);
console.log("Cylinder Surface Area = " + cylinder_surface_area2);

  
  
  
  
/*
run:
  
Cylinder Surface Area = 1099.5574287564277
Cylinder Surface Area = 1099.5574287564275
  
*/

 



answered Nov 15, 2022 by avibootz

Related questions

1 answer 86 views
1 answer 115 views
1 answer 160 views
1 answer 165 views
1 answer 126 views
1 answer 124 views
...