Calculate the area of the triangle
Write a program that receives the rule and height of the triangle and calculates its area
Triangle area = (rule * height) divided by 2
Write a program that receives the rule and height of the triangle and calculates its area
Triangle area = (rule * height) divided by 2
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
base =int(input("enter the base:")) height=int(input("enter the height:")) result=base*height result2=result/2 print(result2)
a = int(input("number1:")) y = int(input("number2:")) print((a * y) / 2)
ghaedeh = int(input("enetr your number:")) # A number of input for the rule ertefah = int(input("enter your number:")) # A number of entrances for height masahat = (ghaedeh * ertefah) / 2 # Triangle area print(f"masahat:{masahat}")
g=float(input('gaede:')) e=float(input('ertefa:')) print(int(g*e/2))
# Triangle area i=int(input("ghahede: ")) y=int(input("ertefah: ")) print((i*y)/2)
print("مساحت:",int(input("قاعده:"))*int(input("ارتفاع:"))/2)
h = float(input('hight: ')) b = float(input('base: ')) s = (b * h)/2 print(f'area of triangle is: {s}')
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.