Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // jshint esversion: 6
- function hypotenuse(a, b){
- return Math.sqrt(a**2 + b**2);
- }
- let hypot, h2, sideA, sideB;
- //Input:
- sideA = prompt("enter A");
- sideB = prompt("enter B");
- //Processing:
- hypot = hypotenuse(sideA, sideB);
- //Output:
- console.log("sideA = " + sideA + " sideB = " + sideB + " hypotenuse = " + hypot);
Add Comment
Please, Sign In to add comment