Advertisement
Spocoman

03. Cone

Jan 19th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(radius, height) {
  2.  
  3.     let volume = Math.PI * radius * radius * height / 3;
  4.     let area = Math.PI * radius * ( radius + Math.sqrt(radius * radius + height * height));
  5.  
  6.     console.log(`volume = ${volume.toFixed(4)}`);
  7.     console.log(`area = ${area.toFixed(4)}`);
  8.  
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement