Write a program to find the area of a triangle ( Hint : area=1/2 b*h)
Answers
Answered by
3
b, h = [float(n) for n in input("enter b & h: ").split()]
print(f"area: {(1 / 2) * b * h}")
Answered by
1
Answer:
Write a program in which programming language? If java then here's the program:
import java.util.*
class area
{
public static void main ()
{
Scanner sc=newScanner(System.in);
double b,h,a;
System.out.println(" Enter height and base of triangle");
b= sc.nextDouble();
h= sc.nextDouble();
a= 1/2*b*h;
System.out.println(" Area of triangle:"+a);
}
}
Similar questions