C Program to Calculate Area of Equilateral Triangle

C Program to Calculate Area 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
#include
#include
#include
void main()
{
int side;
float area,r_4;      // r_4 = root 3 / 4
clrscr();  // Clear Screen

r_4 = sqrt(3) / 4 ;

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

area = r_4 * side * side ;

printf("\n The Area of Equilateral Triangle : %f",area);
getch();
}

No comments:

Post a Comment