import java.util.Scanner;
public class demo1
{
public static void main(String args[])
{
Scanner input= new Scanner(System.in);
System.out.println("Enter the width of the Triangle:");
double b= input.nextDouble();
System.out.println("Enter the height of the Triangle:");
double h= input.nextDouble();
double area=(b*h)/2;
System.out.println("Area of Triangle is: " + area);
}
}Java
Program To Calculate Area Of Triangle.

Written by
View ProfileNikhil Juneja
Passionate software developer and technical contributor at TutorialsLink.
