Skip to content

Commit 967330f

Browse files
Merge pull request #945 from vrushali3297/patch-1
Create Area of triangle
2 parents 8a901b7 + 5e5348d commit 967330f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Area of triangle

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
a = 5
2+
b = 6
3+
c = 7
4+
# a = float(input('Enter first side: '))
5+
# b = float(input('Enter second side: '))
6+
# c = float(input('Enter third side: '))
7+
8+
# calculate the semi-perimeter
9+
s = (a + b + c) / 2
10+
11+
# calculate the area
12+
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
13+
print('The area of the triangle is %0.2f' %area)

0 commit comments

Comments
 (0)