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

suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?

0 Answers   Bank Of America,


What is the best action a system can take when deadlock is detected

2 Answers  


what is the difference between conversion and interface in bdc?

1 Answers  


is possible to delete specific data in a row by using of sql query?

0 Answers   HCL,


Write a pascal program to calculate the sum of the first 100 even number and odd number

0 Answers  






when will triggars the at new event in abap and web dybn pro?

0 Answers   TCS,


Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.

0 Answers  


what is programmable BIST in today ic design

0 Answers   IIT,


What is test execution and when will we start execution please send me one example for this question

0 Answers  


how can i apply validation without using errorprovider in C# windows application

1 Answers  


differences between qtp10.0 and 11.0 ?

0 Answers  


qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again

0 Answers  


Categories