- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Area of a square from diagonal length in C++

**The area** of a figure is the extent of the figure in two-dimensional plane.

**Square** is a quadrilateral with all its sides equal and all internal angles are right angles.

**Diagonal** of a polygon is the line joining two sides that are not adjacent to each other.

ac and bd are the diagonal of the square abcd.

In this problem, we are given the length of diagonals of a square and we have to find are of the square.

Now in triangle abc,

ac2 = bc2 + ab2 d2 = a2 + a2 d = sqrt(2*a2) d2 /2 = a2

And we know are of square = a * a.

Therefore,

**area = d2 /2**

Using this formula we can find the area of a square when the length of diagonal is given,

## Example

#include<iostream> #include<math.h> using namespace std; int main(){ double d = 10; double area = (d * d)/2.0; cout<<"Area of square of diagonal "<<d<<" is "<<area; return 0; }

## Output

area of square of diagonal 10 is 50

- Related Articles
- The area of a square is 11250 m2 find the length of its diagonal.
- Area of hexagon with given diagonal length in C Program?
- C Program for area of hexagon with given diagonal length?
- The area of a square field is $frac{1}{4}$ hectare. Find the length of its diagonal in metres.
- The length of a diagonal of a square is 8. Find the length of each side of the square.
- Find length of Diagonal of Hexagon in C++
- The diagonal of a square is 4√2 then, find the following.A. Length of each side B. Perimeter of the square
- Area of a Circumscribed Circle of a Square in C++
- Python Program to Remove First Diagonal Elements from a Square Matrix
- A square of diagonal 8 cm is inscribed in a circle. Find the area of the region lying inside the circle and outside the square.
- Area of a leaf inside a square in C Program?
- Program for Area Of Square in C++
- The perimeter of a square is 12 cm, find the length of its side and area of the square.
- The area of a square playground is 256.6404 square metres. Find the length of one side of the playground.
- The area of a square plot is 64 m2 . Find the length of its side and perimeter of the square.

Advertisements