how to get right angle triangle when input is 5
#how to get right angle triangle when input is 5
a = int(input("Enter a side: "))
if(a%2==0):
c = ((a*a)/4)+1
b = ((a*a)/4)-1
if(a%2==1):
c = (a*a+1)/2
b = (a*a-1)/2
print("Sides of right angle triangle: ",a,",",b,",",c)
Comments
Leave a comment