151k views
0 votes
The area of a square is stored in a double variable named area. Write an expression whose value is length of the diagonal of the square. Instructor Notes: When it says expression, recall that's just the function call(and stuff here), and not something like myVar = function call(and stuff here)

1 Answer

5 votes

Answer:

sqrt(area)

Step-by-step explanation:

  • Here sqrt is a short form of square root.
  • area is a variable name having he area of square.
  • When the function is called, it will give the square root of the value stored in variable area.

As we have to find the length of the diagonal, we must knew that as all sides of the square are same in length so are the diagonals. This means that each of the four sides of the square and it diagonals are equal in length.

So a square has: length=breadth=diagonal

As Area= length*breadth

√area = length (as length = diagonal length)

So √area = diagonal length

User GrandSteph
by
5.2k points