How to calculate the surface area of cylinder in TypeScript

1 Answer

0 votes
const radius : number = 6;
const height : number = 19;
  
const cylinder_surface_area1 : number = (2 * Math.PI * radius * height) + (2 * Math.PI * (radius * radius));
  
const cylinder_surface_area2 : number = 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 = 942.4777960769379"
"Cylinder Surface Area = 942.4777960769379"
  
*/

 



answered Nov 15, 2022 by avibootz

Related questions

1 answer 136 views
1 answer 129 views
1 answer 211 views
1 answer 164 views
1 answer 411 views
1 answer 183 views
1 answer 176 views
...