Write a Python program to calculate area of an equilateral triangle.

PROGRAM

import math
# Input the side of the equilateral triangle
side = float(input(“Enter the side of the equilateral triangle: “))
# Calculate the area
area = (math.sqrt(3) / 4) * side * side
# Display the result
print(f”The area of the equilateral triangle is: {area:.2f} square units”)

OUTPUT

TRY THE ABOVE CODE

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.