Computer Science
Write a program to find area of a triangle.
Python
Python Funda
195 Likes
Answer
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
Answered By
117 Likes
Related Questions
Write a program to read a number n and print n2, n3 and n4.
Write a short program that asks for your height in centimetres and then converts your height to feet and inches. (1 foot = 12 inches, 1 inch = 2.54 cm).
Write a program to compute simple interest and compound interest.
Write a program to input a number and print its first five multiples.