59.3k views
5 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.

User Manna
by
6.0k points

1 Answer

5 votes
You should specify what language you're using in these types of questions; here's an example in C++.

#include <iostream>
#include <math>

int main()
{
// example area
double area = 25;

// square root the area to find the length
// then apply basic pythagoras
double diagonal = sqrt(pow(sqrt(area), 2) + pow(sqrt(area), 2));

return 0;
}
User Cmac
by
5.8k points