import java.util.Scanner; public class Main { public static void main(String[] args) { Double base,height,area; Scanner s=new Scanner(System.in); System.out.println("Enter the length of the base of the triangle: "); base=s.nextDouble(); System.out.println("Enter the height of the triangle: "); height=s.nextDouble(); area=0.5*base*height; System.out.println(area); } }
Enter the length of the base of the triangle: 10
Enter the height of the triangle: 15
75.0