C program to find area of equilateral triangle

C program to find area of equilateral triangle

Write simple C program to find the area of an equilateral triangle. input side of an equilateral triangle from user. How to find area of an equilateral triangle in C programming. C program to calculate area of an equilateral triangle if its side is given.

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main() 
{
   float side, area;
  
    printf("Enter side of an equilateral triangle: ");
    scanf("%f", &side);
   
    area = (sqrt(3) / 4) * (side * side);
   
    printf("Area of equilateral triangle = %.2f sq. units", area);
    getch();
   }

Output

TOP