In this program find the print the area of a triangle and rectangle. Values of B and H will be taken from user.

print(" Area of rectangle ")
B = int(input(' enter 1st dimension ' ))
H = int(input(' enter 2nd dimension ' ))
print(" area of rectangle of above dimensions is " + str(B*H) + " m^2 ")
print( " area of triangle of above dimensions is " + str(B*H*1/2) + " m^2 ")

Output

Leave a Reply

Your email address will not be published. Required fields are marked *