- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion

# Area of hexagon with given diagonal length in C Program?

A Hexagon is a closed figure of 6 side and a regular hexagon is the one which has all six sides equal and angle equal. For finding the area of hexagon, we are given only the length of its diagonal i.e d.

The interior angles of Hexagon are of 120 degrees each and the sum of all angles of a Hexagon is 720 degrees.

The formula to find the area of hexagon with side length a,

Area = (3a^{2}√3) / 2.

Since all sides are of same size and angle is 120 degrees,

d = 2a or a = d/2

By putting the value of a in the form of d we get area in terms of d,

2 √3 ) / 8

## Example

#include <stdio.h> #include<math.h> int main() { float d = 10; float area = (3 * sqrt(3) * pow(d, 2)) / 8; printf("Area of hexagon = %f",area); return 0; }

## Output

Area of hexagon = 64.951904

- Related Articles
- C Program for area of hexagon with given diagonal length?
- Find length of Diagonal of Hexagon in C++
- Area of a square from diagonal length in C++
- Diagonal of a Regular Hexagon in C++?\n
- Find the number of diagonal in hexagon.
- Swift Program to Calculate Area of Hexagon
- Area of a n-sided regular polygon with given side length in C++
- C++ program to find the Area of the Largest Triangle inscribed in a Hexagon?
- Area of the Largest Triangle inscribed in a Hexagon in C++
- Area of a square inscribed in a circle which is inscribed in a hexagon in C Program?
- C program to interchange the diagonal elements in given matrix
- C Program for Area of a square inscribed in a circle which is inscribed in a hexagon?
- Area of a n-sided regular polygon with given Radius in C Program?
- Program to convert given Matrix to a Diagonal Matrix in C++
- The area of a square is 11250 m2 find the length of its diagonal.

Advertisements