Guest User

Untitled

a guest
Jan 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. // jshint esversion: 6
  2.  
  3. function hypotenuse(a, b){
  4. return Math.sqrt(a**2 + b**2);
  5. }
  6.  
  7. let hypot, h2, sideA, sideB;
  8.  
  9. //Input:
  10. sideA = prompt("enter A");
  11. sideB = prompt("enter B");
  12.  
  13. //Processing:
  14. hypot = hypotenuse(sideA, sideB);
  15.  
  16. //Output:
  17. console.log("sideA = " + sideA + " sideB = " + sideB + " hypotenuse = " + hypot);
Add Comment
Please, Sign In to add comment