Site icon codemaniacstudio

Write a Python program to enter two angles of a triangle and find the third angle.

Write a Python program to enter two angles of a triangle and find the third angle.

SOLUTION....

# Program to find third angle of a triangle

# Input
angle1 = float(input("Enter first angle of triangle: "))
angle2 = float(input("Enter second angle of triangle: "))

# Formula: Sum of angles of a triangle = 180
angle3 = 180 - (angle1 + angle2)

# Output
print("The third angle of the triangle =",angle3)

OUTPUT

Exit mobile version