CBSE Class 11 Computer Science
Question 165 of 173
Data Handling — Question 17
Back to all questions 17
Question Question 17
Write a program to find a side of a right angled triangle whose two sides and an angle is given.
Solution
import math
a = float(input("Enter base: "))
b = float(input("Enter height: "))
x = float(input("Enter angle: "))
c = math.sqrt(a ** 2 + b ** 2)
print("Hypotenuse =", c)Output
Enter base: 10.5
Enter height: 5.5
Enter angle: 60
Hypotenuse = 11.853269591129697