const a = "x"; const b = 4; const c = 6;
var x;
function PythagoreanTherum(a,b,c) {
if (a === "x") { x = (Math.sqrt((c*c)-(b*b))); }
else if (b === "x") { x = (Math.sqrt((c*c)-(a*a))); }
else if (c === "x") { x = (Math.sqrt((a*a) + (b*b))) }
else { console.log("Cannot find x"); return; }
console.log("X = " + (Math.round(x * 100) / 100));
}
PythagoreanTherum(a,b,c);
To embed this project on your website, copy the following code and paste it into your website's HTML: