# How to Calculate Area of Equilatral Triangle using C Language

C Programming

#### Cyber Security : Go from Zero to Hero

Most Popular

60 Lectures 5.5 hours

#### Master C and Embedded C Programming- Learn as you go

Best Seller

66 Lectures 5.5 hours

#### C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

``````
#include<stdio.h>
#include<math.h>

int main() {
int side;
float area, r_4;

r_4 = sqrt(3) / 4;

printf("\nEnter the Length of Side : ");
scanf("%d", &side);

area = r_4 * side * side;

printf("\nArea of Equilateral Triangle : %f", area);
return (0);
}
``````

#### Output :

``````
Enter the Length of Side : 5
Area of Equilateral Triangle : 10.82
``````

#### Properties of Equilateral Triangle :

Equilateral triangle is a triangle in which all three sides are equal .
All angles are of measure 60 degree
A three-sided regular polygon

#### Explanation of Program :

First of all we have to find the value of Root 3 / 2. So we have used following statement to compute the value.

``````
r_4 = sqrt(3) / 4 ;
``````

Now after computing the value of the Root 3 by 2 we have multiplied it by Square of the side.

``````
area = r_4 * side * side ;
``````