write a program in java to enter the base and height of a triangle.calculate and display the area
Answers
Answered by
3
import java.util.*;
public class Triangle
{
public static void main(String[]args)
{
Scanner scan = new Scanner(System.in);
double b,h;
System.out.print("Enter the base of the trianle:");
b=scan.nextDouble();
System.out.print("Enter the height of the trianle:");
h=scan.nextDouble();
double area = (b*h)/2;
System.out.print("Area of the trianle:"+area);
scan.close();
}
}
Hope this helps
Mark Me Brainliest
Answered by
1
class pro
{
public static void main (double a,double b)
{
double a;
double a= 1/2*a*b;
}
}
Hope it helps you
please mark me as the brainliest
{
public static void main (double a,double b)
{
double a;
double a= 1/2*a*b;
}
}
Hope it helps you
please mark me as the brainliest
Similar questions