CBSE Class 11 Computer Science Question 169 of 173

Data Handling — Question 21

Back to all questions
21
Question

Question 21

Write a program to calculate the area of an equilateral triangle. (area = (√3 / 4) * side * side).

Solution
import math

side = float(input("Enter side: "))
area = math.sqrt(3) / 4 * side * side

print("Area of triangle =", area)
Output
Enter side: 5
Area of triangle = 10.825317547305481
Answer