CBSE Class 11 Computer Science Question 101 of 106

Python Fundamentals — Question 10

Back to all questions
10
Question

Question 10

Write a program to find area of a triangle.

Solution
h = float(input("Enter height of the triangle: "))
b = float(input("Enter base of the triangle: "))
area = 0.5 * b * h
print("Area of triangle = ", area)
Output
Enter height of the triangle: 2.5
Enter base of the triangle: 5
Area of triangle =  6.25
Answer