C++ Program to Find Area of Equilateral Triangle

Write C++ Program to Find Area of Equilateral Triangle

// CPP Program to Find Area of Equilateral Triangle

#include <iostream>
#include <math.h>

using namespace std;

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

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

	cout << "Area of Equilateral Triangle having side " << side << " :--> " << area;

	return 0;
}

Output:

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

≪ Previous | Next ≫