C Program to Find Area of Equilateral Triangle

Write C Program to Find Area of Equilateral Triangle

//Write a C Program to Find Area of Equilateral Triangle

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

int main()
{
    float side = 5, area;

    // Formula to compute area of Equilateral triangle
	area = (sqrt(3) / 4) * (side * side);

	printf("Area of Equilateral Triangle having side %0.2f :--> %0.2f", side, area);

	return 0;
}

Output:

Area of Equilateral Triangle having side 5.00 :--> 10.83

≪ Previous | Next ≫