Write a program which inputs 2 integers representing the
sides of a triangle, a
and b. Next, write a function which accepts the 2 sides as
parameters and
returns the hypotenuse of the triangle, c.
Use
c
2
= a
2
+ b
2
To raise a number to an exponent, us
e the built
-
in JavaScript function
Math.pow()
Let’s say you have a variable x and you want to raise it to
the 5
th
power, use
Math.pow in the following manner...
Math.pow(
x,
5
);
This will raise x to the 5
th
power.
To find the square root of a number, use t
he built
-
in JavaScript function
Math.sqrt
()
So to find the square root of x, use Math.pow
()
in the following manner...
Math.sqrt(
x
)
You must create 2 functions to
receive
credit for this assignment. Your

main

function which is called from the button. And your
hypotenuse function.
Again, the main function calls upon the hypotenuse f
unction when it needs that
value. Get the user

s input, call the function, output your result.
Create your own CSS layout


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Programming Languages AllOther Interview Questions

I am looking for selenium RC online Training in chennai. can any one tell me the best institute

0 Answers  


What is the difference between save and create method of activerecord?

0 Answers  


When we use Windows authentication mode

0 Answers  


what is the diffrence between occur 0 and occur 10 in ABAP.

0 Answers  


In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?

0 Answers  






what is web service in java? have u use before.

0 Answers  


what is the extension of SPDS Dynamic cluster tables?

0 Answers   IBM,


what is posix?

1 Answers   HCL,


How to swap values between two variables without using a third variable?

24 Answers   HCL, TCS,


what is fisrt female program

1 Answers  


I m new to the dbms. Recently i came across words clustered indexes & nonclustered indexes but i dont know what is this all about & whats the difference between them.. So please help me!!!!!!!!

0 Answers  


any drawback are there in mantis?

0 Answers  


Categories