import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner n=new Scanner(System.in);
        System.out.println("Enter base of triangle:");
            double base=n.nextDouble();
        System.out.println("Enter height of triangle:");
            double height=n.nextDouble();
    double area=0.5*base*height;
        
        
        System.out.println("The area of the triangle with base " + base + " and height "  + height +  " is: " + area);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: