Programming Examples
Python program to accept three side of triangle and find its area by using Herons Formula
Write a python program to accept 3 side of triangle and find its area by using Heron’s Formula
where s=(a+b+c)/2
import math
a=float(input("Enter the Side 1 "))
b=float(input("Enter the Side 2 "))
c=float(input("Enter the Side 3 "))
s=(a+b+c)/2
area=math.sqrt(s*(s-a)*(s-b)*(s-c))
print("Area of Triangle is : ",area)
Output/ Explanation:
Enter the Side 1 5
Enter the Side 2 4
Enter the Side 3 3
Area of Triangle is : 6.0