Computer Science, asked by pihoogautam23mar2006, 7 months ago

write a program in java to enter the base and height of a triangle.calculate and display the area

Answers

Answered by nafeess2019
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 mayureshbelamakar190
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
Similar questions