Enter 3 side of triangle and calculate area of triangle in python


Write a program in python to enter 3 side of triangle and calculate area of triangle

import math
a=int(input("Enter Side 1 of Triangle: "))
b=int(input("Enter Side 2 of Triangle: "))
c=int(input("Enter Side 3 of Triangle: "))
s=(a+b+c)/2
area=s*math.sqrt((s-a)*(s-b)*(s-c))
print("Area of Triangle is: ", area)

Output:-

Enter Side 1 of Triangle: 5
Enter Side 2 of Triangle: 4
Enter Side 3 of Triangle: 3

Area of Triangle is:  14.696938456699067




Post a Comment

0 Comments